//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (https://www.swig.org).
// Version 4.4.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 DeviceId : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal DeviceId(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DeviceId 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(DeviceId 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);
    }
  }

  ~DeviceId() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

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

  public DeviceId(BusHardwareId busHardwareId_, uint deviceId_, string description_) : this(NanolibPINVOKE.new_DeviceId__SWIG_0(BusHardwareId.getCPtr(busHardwareId_), deviceId_, description_), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public DeviceId(BusHardwareId busHardwareId_, uint deviceId_, string description_, ByteVector extraId_, string extraStringId_) : this(NanolibPINVOKE.new_DeviceId__SWIG_1(BusHardwareId.getCPtr(busHardwareId_), deviceId_, description_, ByteVector.getCPtr(extraId_), extraStringId_), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public DeviceId(DeviceId other) : this(NanolibPINVOKE.new_DeviceId__SWIG_2(DeviceId.getCPtr(other)), true) {
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
  }

  public DeviceId() : this(NanolibPINVOKE.new_DeviceId__SWIG_3(), true) {
  }

  public BusHardwareId getBusHardwareId() {
    BusHardwareId ret = new BusHardwareId(NanolibPINVOKE.DeviceId_getBusHardwareId(swigCPtr), true);
    return ret;
  }

  public uint getDeviceId() {
    uint ret = NanolibPINVOKE.DeviceId_getDeviceId(swigCPtr);
    return ret;
  }

  public string getDescription() {
    string ret = NanolibPINVOKE.DeviceId_getDescription(swigCPtr);
    return ret;
  }

  public ByteVector getExtraId() {
    ByteVector ret = new ByteVector(NanolibPINVOKE.DeviceId_getExtraId(swigCPtr), false);
    return ret;
  }

  public string getExtraStringId() {
    string ret = NanolibPINVOKE.DeviceId_getExtraStringId(swigCPtr);
    return ret;
  }

  public string toString() {
    string ret = NanolibPINVOKE.DeviceId_toString(swigCPtr);
    return ret;
  }

  public bool equals(DeviceId other) {
    bool ret = NanolibPINVOKE.DeviceId_equals(swigCPtr, DeviceId.getCPtr(other));
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
