//------------------------------------------------------------------------------
// <auto-generated />
//
// 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.
//------------------------------------------------------------------------------

namespace  Nlc {

public class ResultProfinetDevices : Result {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;

  internal ResultProfinetDevices(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NanolibPINVOKE.ResultProfinetDevices_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ResultProfinetDevices obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  internal static global::System.Runtime.InteropServices.HandleRef swigRelease(ResultProfinetDevices obj) {
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
      global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.Dispose();
      return ptr;
    } else {
      return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
    }
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          NanolibPINVOKE.delete_ResultProfinetDevices(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public ResultProfinetDevices(ProfinetDeviceVector profinetDevices) : this(NanolibPINVOKE.new_ResultProfinetDevices__SWIG_0(ProfinetDeviceVector.getCPtr(profinetDevices)), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public ResultProfinetDevices(Result result) : this(NanolibPINVOKE.new_ResultProfinetDevices__SWIG_1(Result.getCPtr(result)), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public ResultProfinetDevices(string errorText, NlcErrorCode errorCode, uint extendedErrorCode) : this(NanolibPINVOKE.new_ResultProfinetDevices__SWIG_2(errorText, (int)errorCode, extendedErrorCode), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public ResultProfinetDevices(string errorText, NlcErrorCode errorCode) : this(NanolibPINVOKE.new_ResultProfinetDevices__SWIG_3(errorText, (int)errorCode), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public ResultProfinetDevices(string errorText) : this(NanolibPINVOKE.new_ResultProfinetDevices__SWIG_4(errorText), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public ProfinetDeviceVector getResult() {
    ProfinetDeviceVector ret = new ProfinetDeviceVector(NanolibPINVOKE.ResultProfinetDevices_getResult(swigCPtr), false);
    return ret;
  }

}

}
