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

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

  protected static long getCPtr(WrappedServiceSkel 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_WrappedServiceSkel(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setType(ServiceEntryDefinition value) {
    RobotRaconteurJavaJNI.WrappedServiceSkel_Type_set(swigCPtr, this, ServiceEntryDefinition.getCPtr(value), value);
  }

  public ServiceEntryDefinition getType() {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_Type_get(swigCPtr, this);
    return (cPtr == 0) ? null : new ServiceEntryDefinition(cPtr, true);
  }

  public void setCastobj(WrappedRRObject value) {
    RobotRaconteurJavaJNI.WrappedServiceSkel_castobj_set(swigCPtr, this, WrappedRRObject.getCPtr(value), value);
  }

  public WrappedRRObject getCastobj() {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_castobj_get(swigCPtr, this);
    return (cPtr == 0) ? null : new WrappedRRObject(cPtr, true);
  }

  public WrappedPipeServer getPipe(String membername) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_getPipe(swigCPtr, this, membername);
    return (cPtr == 0) ? null : new WrappedPipeServer(cPtr, true);
  }

  public WrappedWireServer getWire(String membername) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_getWire(swigCPtr, this, membername);
    return (cPtr == 0) ? null : new WrappedWireServer(cPtr, true);
  }

  public void wrappedDispatchEvent(String name, vectorptr_messageelement m) {
    RobotRaconteurJavaJNI.WrappedServiceSkel_wrappedDispatchEvent(swigCPtr, this, name, vectorptr_messageelement.getCPtr(m), m);
  }

  public MessageElement wrappedCallbackCall(String name, long endpoint, vectorptr_messageelement m) {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_wrappedCallbackCall(swigCPtr, this, name, endpoint, vectorptr_messageelement.getCPtr(m), m);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

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

  public int registerGeneratorServer(String function_name, WrappedGeneratorServerDirector gen) {
    return RobotRaconteurJavaJNI.WrappedServiceSkel_registerGeneratorServer(swigCPtr, this, function_name, WrappedGeneratorServerDirector.getCPtr(gen), gen);
  }

  public String getServicePath() {
    return RobotRaconteurJavaJNI.WrappedServiceSkel_getServicePath(swigCPtr, this);
  }

  public ServerContext getContext() {
    long cPtr = RobotRaconteurJavaJNI.WrappedServiceSkel_getContext(swigCPtr, this);
    return (cPtr == 0) ? null : new ServerContext(cPtr, true);
  }

  public WrappedServiceSkel() {
    this(RobotRaconteurJavaJNI.new_WrappedServiceSkel(), true);
  }

}
