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

namespace  Nlc {

public class NlcDataTransferCallback : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal NlcDataTransferCallback(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(NlcDataTransferCallback obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  ~NlcDataTransferCallback() {
    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_NlcDataTransferCallback(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public virtual ResultVoid callback(DataTransferInfo info, int data) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NlcDataTransferCallback_callback(swigCPtr, (int)info, data), true);
    return ret;
  }

  public NlcDataTransferCallback() : this(NanolibPINVOKE.new_NlcDataTransferCallback(), true) {
    SwigDirectorConnect();
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("callback", swigMethodTypes0))
      swigDelegate0 = new SwigDelegateNlcDataTransferCallback_0(SwigDirectorMethodcallback);
    NanolibPINVOKE.NlcDataTransferCallback_director_connect(swigCPtr, swigDelegate0);
  }

  private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
    global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
    bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(NlcDataTransferCallback));
    return hasDerivedMethod;
  }

  private global::System.IntPtr SwigDirectorMethodcallback(int info, int data) {
    return ResultVoid.getCPtr(callback((DataTransferInfo)info, data)).Handle;
  }

  public delegate global::System.IntPtr SwigDelegateNlcDataTransferCallback_0(int info, int data);

  private SwigDelegateNlcDataTransferCallback_0 swigDelegate0;

  private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(DataTransferInfo), typeof(int) };
}

}
