/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.robotraconteur;

public class WrappedSubObjectSubscription {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

  protected WrappedSubObjectSubscription(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(WrappedSubObjectSubscription obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        RobotRaconteurJavaJNI.delete_WrappedSubObjectSubscription(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public WrappedServiceStub getDefaultClient() {
    long cPtr = RobotRaconteurJavaJNI.WrappedSubObjectSubscription_getDefaultClient(swigCPtr, this);
    return (cPtr == 0) ? null : new WrappedServiceStub(cPtr, true);
  }

  public WrappedServiceSubscription_TryDefaultClientRes tryGetDefaultClient() {
    return new WrappedServiceSubscription_TryDefaultClientRes(RobotRaconteurJavaJNI.WrappedSubObjectSubscription_tryGetDefaultClient(swigCPtr, this), true);
  }

  public WrappedServiceStub getDefaultClientWait(int timeout) {
    long cPtr = RobotRaconteurJavaJNI.WrappedSubObjectSubscription_getDefaultClientWait__SWIG_0(swigCPtr, this, timeout);
    return (cPtr == 0) ? null : new WrappedServiceStub(cPtr, true);
  }

  public WrappedServiceStub getDefaultClientWait() {
    long cPtr = RobotRaconteurJavaJNI.WrappedSubObjectSubscription_getDefaultClientWait__SWIG_1(swigCPtr, this);
    return (cPtr == 0) ? null : new WrappedServiceStub(cPtr, true);
  }

  public WrappedServiceSubscription_TryDefaultClientRes tryGetDefaultClientWait(int timeout) {
    return new WrappedServiceSubscription_TryDefaultClientRes(RobotRaconteurJavaJNI.WrappedSubObjectSubscription_tryGetDefaultClientWait__SWIG_0(swigCPtr, this, timeout), true);
  }

  public WrappedServiceSubscription_TryDefaultClientRes tryGetDefaultClientWait() {
    return new WrappedServiceSubscription_TryDefaultClientRes(RobotRaconteurJavaJNI.WrappedSubObjectSubscription_tryGetDefaultClientWait__SWIG_1(swigCPtr, this), true);
  }

  public void asyncGetDefaultClient(int timeout, AsyncStubReturnDirector handler, int id) {
    RobotRaconteurJavaJNI.WrappedSubObjectSubscription_asyncGetDefaultClient(swigCPtr, this, timeout, AsyncStubReturnDirector.getCPtr(handler), handler, id);
  }

  public void close() {
    RobotRaconteurJavaJNI.WrappedSubObjectSubscription_close(swigCPtr, this);
  }

  public RobotRaconteurNode getNode() {
    long cPtr = RobotRaconteurJavaJNI.WrappedSubObjectSubscription_getNode(swigCPtr, this);
    return (cPtr == 0) ? null : new RobotRaconteurNode(cPtr, true);
  }

}
