/* ----------------------------------------------------------------------------
 * 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 btllib;

public class DataStreamPipeline {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

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

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

  public DataStreamPipeline() {
    this(btllibJNI.new_DataStreamPipeline__SWIG_0(), true);
  }

  public DataStreamPipeline(DataStreamPipeline.Direction direction, SWIGTYPE_p_pid_t pid_first, SWIGTYPE_p_pid_t pid_last) {
    this(btllibJNI.new_DataStreamPipeline__SWIG_1(direction.swigValue(), SWIGTYPE_p_pid_t.getCPtr(pid_first), SWIGTYPE_p_pid_t.getCPtr(pid_last)), true);
  }

  public void finish() {
    btllibJNI.DataStreamPipeline_finish(swigCPtr, this);
  }

  public void setDirection(DataStreamPipeline.Direction value) {
    btllibJNI.DataStreamPipeline_direction_set(swigCPtr, this, value.swigValue());
  }

  public DataStreamPipeline.Direction getDirection() {
    return DataStreamPipeline.Direction.swigToEnum(btllibJNI.DataStreamPipeline_direction_get(swigCPtr, this));
  }

  public void setPid_first(SWIGTYPE_p_pid_t value) {
    btllibJNI.DataStreamPipeline_pid_first_set(swigCPtr, this, SWIGTYPE_p_pid_t.getCPtr(value));
  }

  public SWIGTYPE_p_pid_t getPid_first() {
    return new SWIGTYPE_p_pid_t(btllibJNI.DataStreamPipeline_pid_first_get(swigCPtr, this), true);
  }

  public void setPid_last(SWIGTYPE_p_pid_t value) {
    btllibJNI.DataStreamPipeline_pid_last_set(swigCPtr, this, SWIGTYPE_p_pid_t.getCPtr(value));
  }

  public SWIGTYPE_p_pid_t getPid_last() {
    return new SWIGTYPE_p_pid_t(btllibJNI.DataStreamPipeline_pid_last_get(swigCPtr, this), true);
  }

  public void setClosed(boolean value) {
    btllibJNI.DataStreamPipeline_closed_set(swigCPtr, this, value);
  }

  public boolean getClosed() {
    return btllibJNI.DataStreamPipeline_closed_get(swigCPtr, this);
  }

  public final static class Direction {
    public final static DataStreamPipeline.Direction SOURCE = new DataStreamPipeline.Direction("SOURCE");
    public final static DataStreamPipeline.Direction SINK = new DataStreamPipeline.Direction("SINK");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static Direction swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + Direction.class + " with value " + swigValue);
    }

    private Direction(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private Direction(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private Direction(String swigName, Direction swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static Direction[] swigValues = { SOURCE, SINK };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
