/* ----------------------------------------------------------------------------
 * 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 IntraTransport extends Transport {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected IntraTransport(long cPtr, boolean cMemoryOwn) {
    super(RobotRaconteurJavaJNI.IntraTransport_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        RobotRaconteurJavaJNI.delete_IntraTransport(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public IntraTransport() {
    this(RobotRaconteurJavaJNI.new_IntraTransport__SWIG_0(), true);
  }

  public IntraTransport(RobotRaconteurNode node) {
    this(RobotRaconteurJavaJNI.new_IntraTransport__SWIG_1(RobotRaconteurNode.getCPtr(node), node), true);
  }

  public String getUrlSchemeString() {
    return RobotRaconteurJavaJNI.IntraTransport_getUrlSchemeString(swigCPtr, this);
  }

  public vectorstring getServerListenUrls() {
    return new vectorstring(RobotRaconteurJavaJNI.IntraTransport_getServerListenUrls(swigCPtr, this), true);
  }

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

  public void startClient() {
    RobotRaconteurJavaJNI.IntraTransport_startClient(swigCPtr, this);
  }

  public void startServer() {
    RobotRaconteurJavaJNI.IntraTransport_startServer(swigCPtr, this);
  }

}
