Urbi SDK Remote for Java  2.7.5
UContext.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   /** Methods available in both UObject and UVar
00011    *  Wrapper around UContextImpl to enable access through inheritance.
00012    */
00013 
00014 public class UContext {
00015   private long swigCPtr;
00016   protected boolean swigCMemOwn;
00017 
00018   public UContext(long cPtr, boolean cMemoryOwn) {
00019     swigCMemOwn = cMemoryOwn;
00020     swigCPtr = cPtr;
00021   }
00022 
00023   public static long getCPtr(UContext obj) {
00024     return (obj == null) ? 0 : obj.swigCPtr;
00025   }
00026 
00027   protected void finalize() {
00028     delete();
00029   }
00030 
00031   public synchronized void delete() {
00032     if (swigCPtr != 0) {
00033       if (swigCMemOwn) {
00034         swigCMemOwn = false;
00035         urbiJNI.delete_UContext(swigCPtr);
00036       }
00037       swigCPtr = 0;
00038     }
00039   }
00040 
00041   public UContext(UContextImpl ctx) {
00042     this(urbiJNI.new_UContext__SWIG_0(UContextImpl.getCPtr(ctx), ctx), true);
00043   }
00044 
00045   public UContext() {
00046     this(urbiJNI.new_UContext__SWIG_1(), true);
00047   }
00048 
00049   public UObjectHub getUObjectHub(String n) {
00050     long cPtr = urbiJNI.UContext_getUObjectHub(swigCPtr, this, n);
00051     return (cPtr == 0) ? null : new UObjectHub(cPtr, false);
00052   }
00053 
00054   public UObjectCPP getUObject(String n) {
00055     long cPtr = urbiJNI.UContext_getUObject(swigCPtr, this, n);
00056     return (cPtr == 0) ? null : new UObjectCPP(cPtr, false);
00057   }
00058 
00059       /// Send Urbi code (ghost connection in plugin mode, default
00060     /// connection in remote mode).
00061  public  void uobject_unarmorAndSend(String str) {
00062     urbiJNI.UContext_uobject_unarmorAndSend(swigCPtr, this, str);
00063   }
00064 
00065       /// Send buf to the connection hosting the UObject.
00066  public  void send(String str) {
00067     urbiJNI.UContext_send__SWIG_0(swigCPtr, this, str);
00068   }
00069 
00070   public void call(String object, String method, UAutoValue v1, UAutoValue v2, UAutoValue v3, UAutoValue v4, UAutoValue v5, UAutoValue v6) {
00071     urbiJNI.UContext_call__SWIG_0(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1, UAutoValue.getCPtr(v2), v2, UAutoValue.getCPtr(v3), v3, UAutoValue.getCPtr(v4), v4, UAutoValue.getCPtr(v5), v5, UAutoValue.getCPtr(v6), v6);
00072   }
00073 
00074   public void call(String object, String method, UAutoValue v1, UAutoValue v2, UAutoValue v3, UAutoValue v4, UAutoValue v5) {
00075     urbiJNI.UContext_call__SWIG_1(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1, UAutoValue.getCPtr(v2), v2, UAutoValue.getCPtr(v3), v3, UAutoValue.getCPtr(v4), v4, UAutoValue.getCPtr(v5), v5);
00076   }
00077 
00078   public void call(String object, String method, UAutoValue v1, UAutoValue v2, UAutoValue v3, UAutoValue v4) {
00079     urbiJNI.UContext_call__SWIG_2(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1, UAutoValue.getCPtr(v2), v2, UAutoValue.getCPtr(v3), v3, UAutoValue.getCPtr(v4), v4);
00080   }
00081 
00082   public void call(String object, String method, UAutoValue v1, UAutoValue v2, UAutoValue v3) {
00083     urbiJNI.UContext_call__SWIG_3(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1, UAutoValue.getCPtr(v2), v2, UAutoValue.getCPtr(v3), v3);
00084   }
00085 
00086   public void call(String object, String method, UAutoValue v1, UAutoValue v2) {
00087     urbiJNI.UContext_call__SWIG_4(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1, UAutoValue.getCPtr(v2), v2);
00088   }
00089 
00090   public void call(String object, String method, UAutoValue v1) {
00091     urbiJNI.UContext_call__SWIG_5(swigCPtr, this, object, method, UAutoValue.getCPtr(v1), v1);
00092   }
00093 
00094   public void call(String object, String method) {
00095     urbiJNI.UContext_call__SWIG_6(swigCPtr, this, object, method);
00096   }
00097 
00098   public SWIGTYPE_p_boost__asio__io_service getIoService() {
00099     return new SWIGTYPE_p_boost__asio__io_service(urbiJNI.UContext_getIoService(swigCPtr, this), false);
00100   }
00101 
00102       /// Return the mode in which the code is running.
00103  public  UObjectMode getRunningMode() {
00104     return UObjectMode.swigToEnum(urbiJNI.UContext_getRunningMode(swigCPtr, this));
00105   }
00106 
00107       /// Return true if the code is running in plugin mode.
00108  public  boolean isPluginMode() {
00109     return urbiJNI.UContext_isPluginMode(swigCPtr, this);
00110   }
00111 
00112       /// Return true if the code is running in remote mode.
00113  public  boolean isRemoteMode() {
00114     return urbiJNI.UContext_isRemoteMode(swigCPtr, this);
00115   }
00116 
00117       /// Yield execution until next cycle.
00118     /// Process pending messages in remote mode.
00119  public  void yield() {
00120     urbiJNI.UContext_yield(swigCPtr, this);
00121   }
00122 
00123       /** Yield execution until something else is scheduled, or until a message is
00124      * received in remote mode.
00125      */
00126  public  void yield_until_things_changed() {
00127     urbiJNI.UContext_yield_until_things_changed(swigCPtr, this);
00128   }
00129 
00130       /** If \b s is true, mark the current task as having no side effect.
00131      * This call has no effect in remote mode.
00132      */
00133  public  void side_effect_free_set(boolean s) {
00134     urbiJNI.UContext_side_effect_free_set(swigCPtr, this, s);
00135   }
00136 
00137       /// Get the current side_effect_free state.
00138  public  boolean side_effect_free_get() {
00139     return urbiJNI.UContext_side_effect_free_get(swigCPtr, this);
00140   }
00141 
00142       /// Get the version of the kernel that will receive send() messages.
00143  public  IntPair kernelVersion() {
00144     return new IntPair(urbiJNI.UContext_kernelVersion(swigCPtr, this), true);
00145   }
00146 
00147   public void setCtx_(UContextImpl value) {
00148     urbiJNI.UContext_ctx__set(swigCPtr, this, UContextImpl.getCPtr(value), value);
00149   }
00150 
00151   public UContextImpl getCtx_() {
00152     long cPtr = urbiJNI.UContext_ctx__get(swigCPtr, this);
00153     return (cPtr == 0) ? null : new UContextImpl(cPtr, false);
00154   }
00155 
00156       /// Send buf to the connection hosting the UObject.
00157  public  void send(byte[] buf, long size) {
00158     urbiJNI.UContext_send__SWIG_2(swigCPtr, this, buf, size);
00159   }
00160 
00161       /// Yield execution for \b delay.
00162  public  void yield_for(long delay) {
00163     urbiJNI.UContext_yield_for(swigCPtr, this, delay);
00164   }
00165 
00166       /// Yield execution until \b deadline is met (see libport::utime()).
00167  public  void yield_until(long delay) {
00168     urbiJNI.UContext_yield_until(swigCPtr, this, delay);
00169   }
00170 
00171 }