/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.nanotec.nanolib;

public class ResultSamplerState extends Result {
  private transient long swigCPtr;

  protected ResultSamplerState(long cPtr, boolean cMemoryOwn) {
    super(NanolibJNI.ResultSamplerState_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected static long swigRelease(ResultSamplerState obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        NanolibJNI.delete_ResultSamplerState(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public ResultSamplerState(SamplerState state) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_0(state.swigValue()), true);
  }

  public ResultSamplerState(String errorDesc, NlcErrorCode errorCode, long extendedErrorCode) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_1(errorDesc, errorCode.swigValue(), extendedErrorCode), true);
  }

  public ResultSamplerState(String errorDesc, NlcErrorCode errorCode) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_2(errorDesc, errorCode.swigValue()), true);
  }

  public ResultSamplerState(String errorDesc) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_3(errorDesc), true);
  }

  public ResultSamplerState(ResultSamplerState other) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_4(ResultSamplerState.getCPtr(other), other), true);
  }

  public ResultSamplerState(Result result) {
    this(NanolibJNI.new_ResultSamplerState__SWIG_5(Result.getCPtr(result), result), true);
  }

  public SamplerState getResult() {
    return SamplerState.swigToEnum(NanolibJNI.ResultSamplerState_getResult(swigCPtr, this));
  }

}
