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

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

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

  public MessageElement getInValue() {
    long cPtr = RobotRaconteurJavaJNI.WrappedWireConnection_getInValue(swigCPtr, this);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

  public MessageElement getOutValue() {
    long cPtr = RobotRaconteurJavaJNI.WrappedWireConnection_getOutValue(swigCPtr, this);
    return (cPtr == 0) ? null : new MessageElement(cPtr, true);
  }

  public void setOutValue(MessageElement value) {
    RobotRaconteurJavaJNI.WrappedWireConnection_setOutValue(swigCPtr, this, MessageElement.getCPtr(value), value);
  }

  public void setRRDirector(WrappedWireConnectionDirector director, int id) {
    RobotRaconteurJavaJNI.WrappedWireConnection_setRRDirector(swigCPtr, this, WrappedWireConnectionDirector.getCPtr(director), director, id);
  }

  public void setType(TypeDefinition value) {
    RobotRaconteurJavaJNI.WrappedWireConnection_Type_set(swigCPtr, this, TypeDefinition.getCPtr(value), value);
  }

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

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

  public long getEndpoint() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getEndpoint(swigCPtr, this);
  }

  public TimeSpec getLastValueReceivedTime() {
    return new TimeSpec(RobotRaconteurJavaJNI.WrappedWireConnection_getLastValueReceivedTime(swigCPtr, this), true);
  }

  public TimeSpec getLastValueSentTime() {
    return new TimeSpec(RobotRaconteurJavaJNI.WrappedWireConnection_getLastValueSentTime(swigCPtr, this), true);
  }

  public boolean getInValueValid() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getInValueValid(swigCPtr, this);
  }

  public boolean getOutValueValid() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getOutValueValid(swigCPtr, this);
  }

  public TryGetValueResult tryGetInValue() {
    return new TryGetValueResult(RobotRaconteurJavaJNI.WrappedWireConnection_tryGetInValue(swigCPtr, this), true);
  }

  public TryGetValueResult tryGetOutValue() {
    return new TryGetValueResult(RobotRaconteurJavaJNI.WrappedWireConnection_tryGetOutValue(swigCPtr, this), true);
  }

  public void asyncClose(int timeout, AsyncVoidReturnDirector handler, int id) {
    RobotRaconteurJavaJNI.WrappedWireConnection_asyncClose(swigCPtr, this, timeout, AsyncVoidReturnDirector.getCPtr(handler), handler, id);
  }

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

  public boolean getIgnoreInValue() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getIgnoreInValue(swigCPtr, this);
  }

  public void setIgnoreInValue(boolean ignore) {
    RobotRaconteurJavaJNI.WrappedWireConnection_setIgnoreInValue(swigCPtr, this, ignore);
  }

  public int getInValueLifespan() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getInValueLifespan(swigCPtr, this);
  }

  public void setInValueLifespan(int millis) {
    RobotRaconteurJavaJNI.WrappedWireConnection_setInValueLifespan(swigCPtr, this, millis);
  }

  public int getOutValueLifespan() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_getOutValueLifespan(swigCPtr, this);
  }

  public void setOutValueLifespan(int millis) {
    RobotRaconteurJavaJNI.WrappedWireConnection_setOutValueLifespan(swigCPtr, this, millis);
  }

  public boolean waitInValueValid(int timeout) {
    return RobotRaconteurJavaJNI.WrappedWireConnection_waitInValueValid__SWIG_0(swigCPtr, this, timeout);
  }

  public boolean waitInValueValid() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_waitInValueValid__SWIG_1(swigCPtr, this);
  }

  public boolean waitOutValueValid(int timeout) {
    return RobotRaconteurJavaJNI.WrappedWireConnection_waitOutValueValid__SWIG_0(swigCPtr, this, timeout);
  }

  public boolean waitOutValueValid() {
    return RobotRaconteurJavaJNI.WrappedWireConnection_waitOutValueValid__SWIG_1(swigCPtr, this);
  }

  public MemberDefinition_Direction direction() {
    return MemberDefinition_Direction.swigToEnum(RobotRaconteurJavaJNI.WrappedWireConnection_direction(swigCPtr, this));
  }

}
