Urbi SDK Remote for Java  2.7.5
UObjectCPP.java
00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 2.0.4
00004  *
00005  * Do not make changes to this file unless you know what you are doing--modify
00006  * the SWIG interface file instead.
00007  * ----------------------------------------------------------------------------- */
00008 
00009 package urbi;
00010   /** Main UObject class definition
00011       Each UObject instance corresponds to an URBI object.
00012       It provides mechanisms to bind variables and functions between
00013       C++ and Urbi.
00014   */
00015 
00016 public class UObjectCPP extends UContext {
00017   private long swigCPtr;
00018 
00019   public UObjectCPP(long cPtr, boolean cMemoryOwn) {
00020     super(urbiJNI.UObjectCPP_SWIGUpcast(cPtr), cMemoryOwn);
00021     swigCPtr = cPtr;
00022   }
00023 
00024   public static long getCPtr(UObjectCPP obj) {
00025     return (obj == null) ? 0 : obj.swigCPtr;
00026   }
00027 
00028   protected void finalize() {
00029     delete();
00030   }
00031 
00032   public synchronized void delete() {
00033     if (swigCPtr != 0) {
00034       if (swigCMemOwn) {
00035         swigCMemOwn = false;
00036         urbiJNI.delete_UObjectCPP(swigCPtr);
00037       }
00038       swigCPtr = 0;
00039     }
00040     super.delete();
00041   }
00042 
00043   protected void swigDirectorDisconnect() {
00044     swigCMemOwn = false;
00045     delete();
00046   }
00047 
00048   public void swigReleaseOwnership() {
00049     swigCMemOwn = false;
00050     urbiJNI.UObjectCPP_change_ownership(this, swigCPtr, false);
00051   }
00052 
00053   public void swigTakeOwnership() {
00054     swigCMemOwn = true;
00055     urbiJNI.UObjectCPP_change_ownership(this, swigCPtr, true);
00056   }
00057 
00058       /// Reserved for internal use
00059  public  UObjectCPP(UContextImpl impl) {
00060     this(urbiJNI.new_UObjectCPP__SWIG_0(UContextImpl.getCPtr(impl), impl), true);
00061     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00062   }
00063 
00064       /// Reserved for internal use
00065  public  UObjectCPP() {
00066     this(urbiJNI.new_UObjectCPP__SWIG_1(), true);
00067     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00068   }
00069 
00070       /// Reserved for internal use
00071  public  UObjectCPP(String arg0, UContextImpl impl) {
00072     this(urbiJNI.new_UObjectCPP__SWIG_2(arg0, UContextImpl.getCPtr(impl), impl), true);
00073     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00074   }
00075 
00076       /// Reserved for internal use
00077  public  UObjectCPP(String arg0) {
00078     this(urbiJNI.new_UObjectCPP__SWIG_3(arg0), true);
00079     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00080   }
00081 
00082       /// Reserved for internal use
00083  public  UObjectCPP(int arg0, UContextImpl impl) {
00084     this(urbiJNI.new_UObjectCPP__SWIG_4(arg0, UContextImpl.getCPtr(impl), impl), true);
00085     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00086   }
00087 
00088       /// Reserved for internal use
00089  public  UObjectCPP(int arg0) {
00090     this(urbiJNI.new_UObjectCPP__SWIG_5(arg0), true);
00091     urbiJNI.UObjectCPP_director_connect(this, swigCPtr, swigCMemOwn, true);
00092   }
00093 
00094       /// Remove a timer registered with USetTimer.
00095  public  boolean removeTimer(TimerHandle h) {
00096     return urbiJNI.UObjectCPP_removeTimer(swigCPtr, this, TimerHandle.getCPtr(h), h);
00097   }
00098 
00099       /// Request permanent synchronization for v.
00100  public  void USync(UVar v) {
00101     urbiJNI.UObjectCPP_USync(swigCPtr, this, UVar.getCPtr(v), v);
00102   }
00103 
00104   public void set__name(String value) {
00105     urbiJNI.UObjectCPP___name_set(swigCPtr, this, value);
00106   }
00107 
00108   public String get__name() {
00109     return urbiJNI.UObjectCPP___name_get(swigCPtr, this);
00110   }
00111 
00112   public void setClassname(String value) {
00113     urbiJNI.UObjectCPP_classname_set(swigCPtr, this, value);
00114   }
00115 
00116   public String getClassname() {
00117     return urbiJNI.UObjectCPP_classname_get(swigCPtr, this);
00118   }
00119 
00120   public void setDerived(boolean value) {
00121     urbiJNI.UObjectCPP_derived_set(swigCPtr, this, value);
00122   }
00123 
00124   public boolean getDerived() {
00125     return urbiJNI.UObjectCPP_derived_get(swigCPtr, this);
00126   }
00127 
00128   public void setObjecthub(UObjectHub value) {
00129     urbiJNI.UObjectCPP_objecthub_set(swigCPtr, this, UObjectHub.getCPtr(value), value);
00130   }
00131 
00132   public UObjectHub getObjecthub() {
00133     long cPtr = urbiJNI.UObjectCPP_objecthub_get(swigCPtr, this);
00134     return (cPtr == 0) ? null : new UObjectHub(cPtr, false);
00135   }
00136 
00137       /// Set a timer that will call the update function every 'period'
00138     /// milliseconds.
00139  public  void USetUpdate(double period) {
00140     urbiJNI.UObjectCPP_USetUpdate(swigCPtr, this, period);
00141   }
00142 
00143   public int update() {
00144     return (getClass() == UObjectCPP.class) ? urbiJNI.UObjectCPP_update(swigCPtr, this) : urbiJNI.UObjectCPP_updateSwigExplicitUObjectCPP(swigCPtr, this);
00145   }
00146 
00147   public void UAutoGroup() {
00148     urbiJNI.UObjectCPP_UAutoGroup(swigCPtr, this);
00149   }
00150 
00151   public void addAutoGroup() {
00152     if (getClass() == UObjectCPP.class) urbiJNI.UObjectCPP_addAutoGroup(swigCPtr, this); else urbiJNI.UObjectCPP_addAutoGroupSwigExplicitUObjectCPP(swigCPtr, this);
00153   }
00154 
00155   public void UJoinGroup(String gpname) {
00156     if (getClass() == UObjectCPP.class) urbiJNI.UObjectCPP_UJoinGroup(swigCPtr, this, gpname); else urbiJNI.UObjectCPP_UJoinGroupSwigExplicitUObjectCPP(swigCPtr, this, gpname);
00157   }
00158 
00159   public void setAutogroup(boolean value) {
00160     urbiJNI.UObjectCPP_autogroup_set(swigCPtr, this, value);
00161   }
00162 
00163   public boolean getAutogroup() {
00164     return urbiJNI.UObjectCPP_autogroup_get(swigCPtr, this);
00165   }
00166 
00167       /// \}
00168     /// Void function used in USync callbacks.
00169  public  int voidfun() {
00170     return urbiJNI.UObjectCPP_voidfun(swigCPtr, this);
00171   }
00172 
00173   public void setRemote(boolean value) {
00174     urbiJNI.UObjectCPP_remote_set(swigCPtr, this, value);
00175   }
00176 
00177   public boolean getRemote() {
00178     return urbiJNI.UObjectCPP_remote_get(swigCPtr, this);
00179   }
00180 
00181       /// Remove all bindings, this method is called by the destructor.
00182  public  void clean() {
00183     urbiJNI.UObjectCPP_clean(swigCPtr, this);
00184   }
00185 
00186   public SWIGTYPE_p_libport__ThreadPool__rTaskLock getTaskLock(LockMode m, String what) {
00187     return new SWIGTYPE_p_libport__ThreadPool__rTaskLock(urbiJNI.UObjectCPP_getTaskLock__SWIG_0(swigCPtr, this, m.swigValue(), what), true);
00188   }
00189 
00190   public SWIGTYPE_p_libport__ThreadPool__rTaskLock getTaskLock(LockSpec s, String what) {
00191     return new SWIGTYPE_p_libport__ThreadPool__rTaskLock(urbiJNI.UObjectCPP_getTaskLock__SWIG_1(swigCPtr, this, LockSpec.getCPtr(s), s, what), true);
00192   }
00193 
00194   public UObjectImpl impl_get() {
00195     long cPtr = urbiJNI.UObjectCPP_impl_get(swigCPtr, this);
00196     return (cPtr == 0) ? null : new UObjectImpl(cPtr, false);
00197   }
00198 
00199       // Override me to have your own LOCK_CLASS task lock.
00200  public  SWIGTYPE_p_libport__ThreadPool__rTaskLock getClassTaskLock() {
00201     return new SWIGTYPE_p_libport__ThreadPool__rTaskLock((getClass() == UObjectCPP.class) ? urbiJNI.UObjectCPP_getClassTaskLock(swigCPtr, this) : urbiJNI.UObjectCPP_getClassTaskLockSwigExplicitUObjectCPP(swigCPtr, this), true);
00202   }
00203 
00204   public void setLoad(UValue val) {
00205     urbiJNI.UObjectCPP_setLoad(swigCPtr, this, UValue.getCPtr(val), val);
00206   }
00207 
00208   public UVar getLoad() {
00209     return new UVar(urbiJNI.UObjectCPP_getLoad(swigCPtr, this), false);
00210   }
00211 
00212   public void setCloner(baseURBIStarter cloner) {
00213     urbiJNI.UObjectCPP_setCloner(swigCPtr, this, baseURBIStarter.getCPtr(cloner), cloner);
00214   }
00215 
00216 }