/* ----------------------------------------------------------------------------
 * 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 WrappedServiceSkelDirector {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

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

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

  protected void swigDirectorDisconnect() {
    swigCMemOwn = false;
    delete();
  }

  public void swigReleaseOwnership() {
    swigCMemOwn = false;
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_change_ownership(this, swigCPtr, false);
  }

  public void swigTakeOwnership() {
    swigCMemOwn = true;
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_change_ownership(this, swigCPtr, true);
  }

  public void init(WrappedServiceSkel skel) {
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_init(swigCPtr, this, WrappedServiceSkel.getCPtr(skel), skel);
  }

  public MessageElement _CallGetProperty(String name, WrappedServiceSkelAsyncAdapter async_adaptor) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__CallGetProperty(swigCPtr, this, name, WrappedServiceSkelAsyncAdapter.getCPtr(async_adaptor), async_adaptor);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

  public void _CallSetProperty(String name, MessageElement m, WrappedServiceSkelAsyncAdapter async_adaptor) {
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector__CallSetProperty(swigCPtr, this, name, MessageElement.getCPtr(m), m, WrappedServiceSkelAsyncAdapter.getCPtr(async_adaptor), async_adaptor);
  }

  public MessageElement _CallFunction(String name, vectorptr_messageelement m, WrappedServiceSkelAsyncAdapter async_adaptor) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__CallFunction(swigCPtr, this, name, vectorptr_messageelement.getCPtr(m), m, WrappedServiceSkelAsyncAdapter.getCPtr(async_adaptor), async_adaptor);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

  public WrappedRRObject _GetSubObj(String name, String index) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetSubObj(swigCPtr, this, name, index);
    return (cPtr == 0) ? null : new WrappedRRObject(cPtr, true);
  }

  public WrappedArrayMemoryDirector _GetArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedArrayMemoryDirector(cPtr, false);
  }

  public WrappedMultiDimArrayMemoryDirector _GetMultiDimArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetMultiDimArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedMultiDimArrayMemoryDirector(cPtr, false);
  }

  public WrappedPodArrayMemoryDirector _GetPodArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetPodArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedPodArrayMemoryDirector(cPtr, false);
  }

  public WrappedPodMultiDimArrayMemoryDirector _GetPodMultiDimArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetPodMultiDimArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedPodMultiDimArrayMemoryDirector(cPtr, false);
  }

  public WrappedNamedArrayMemoryDirector _GetNamedArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetNamedArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedNamedArrayMemoryDirector(cPtr, false);
  }

  public WrappedNamedMultiDimArrayMemoryDirector _GetNamedMultiDimArrayMemory(String name) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkelDirector__GetNamedMultiDimArrayMemory(swigCPtr, this, name);
    return (cPtr == 0) ? null : new WrappedNamedMultiDimArrayMemoryDirector(cPtr, false);
  }

  public void monitorEnter(int timeout) {
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_monitorEnter(swigCPtr, this, timeout);
  }

  public void monitorExit() {
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_monitorExit(swigCPtr, this);
  }

  public void releaseCastObject() {
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_releaseCastObject(swigCPtr, this);
  }

  public WrappedServiceSkelDirector() {
    this(RobotRaconteurJavaJNI.new_WrappedServiceSkelDirector(), true);
    RobotRaconteurJavaJNI.WrappedServiceSkelDirector_director_connect(this, swigCPtr, true, true);
  }

}
