DDebugCallback.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class DDebugCallback : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal DDebugCallback(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(DDebugCallback obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~DDebugCallback() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_DDebugCallback(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public DDebugCallback() : this(tinyWRAPPINVOKE.new_DDebugCallback(), true) {
  37. SwigDirectorConnect();
  38. }
  39. public virtual int OnDebugInfo(string message) {
  40. int ret = (SwigDerivedClassHasMethod("OnDebugInfo", swigMethodTypes0) ? tinyWRAPPINVOKE.DDebugCallback_OnDebugInfoSwigExplicitDDebugCallback(swigCPtr, message) : tinyWRAPPINVOKE.DDebugCallback_OnDebugInfo(swigCPtr, message));
  41. return ret;
  42. }
  43. public virtual int OnDebugWarn(string message) {
  44. int ret = (SwigDerivedClassHasMethod("OnDebugWarn", swigMethodTypes1) ? tinyWRAPPINVOKE.DDebugCallback_OnDebugWarnSwigExplicitDDebugCallback(swigCPtr, message) : tinyWRAPPINVOKE.DDebugCallback_OnDebugWarn(swigCPtr, message));
  45. return ret;
  46. }
  47. public virtual int OnDebugError(string message) {
  48. int ret = (SwigDerivedClassHasMethod("OnDebugError", swigMethodTypes2) ? tinyWRAPPINVOKE.DDebugCallback_OnDebugErrorSwigExplicitDDebugCallback(swigCPtr, message) : tinyWRAPPINVOKE.DDebugCallback_OnDebugError(swigCPtr, message));
  49. return ret;
  50. }
  51. public virtual int OnDebugFatal(string message) {
  52. int ret = (SwigDerivedClassHasMethod("OnDebugFatal", swigMethodTypes3) ? tinyWRAPPINVOKE.DDebugCallback_OnDebugFatalSwigExplicitDDebugCallback(swigCPtr, message) : tinyWRAPPINVOKE.DDebugCallback_OnDebugFatal(swigCPtr, message));
  53. return ret;
  54. }
  55. private void SwigDirectorConnect() {
  56. if (SwigDerivedClassHasMethod("OnDebugInfo", swigMethodTypes0))
  57. swigDelegate0 = new SwigDelegateDDebugCallback_0(SwigDirectorOnDebugInfo);
  58. if (SwigDerivedClassHasMethod("OnDebugWarn", swigMethodTypes1))
  59. swigDelegate1 = new SwigDelegateDDebugCallback_1(SwigDirectorOnDebugWarn);
  60. if (SwigDerivedClassHasMethod("OnDebugError", swigMethodTypes2))
  61. swigDelegate2 = new SwigDelegateDDebugCallback_2(SwigDirectorOnDebugError);
  62. if (SwigDerivedClassHasMethod("OnDebugFatal", swigMethodTypes3))
  63. swigDelegate3 = new SwigDelegateDDebugCallback_3(SwigDirectorOnDebugFatal);
  64. tinyWRAPPINVOKE.DDebugCallback_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3);
  65. }
  66. private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
  67. System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
  68. bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(DDebugCallback));
  69. return hasDerivedMethod;
  70. }
  71. private int SwigDirectorOnDebugInfo(string message) {
  72. return OnDebugInfo(message);
  73. }
  74. private int SwigDirectorOnDebugWarn(string message) {
  75. return OnDebugWarn(message);
  76. }
  77. private int SwigDirectorOnDebugError(string message) {
  78. return OnDebugError(message);
  79. }
  80. private int SwigDirectorOnDebugFatal(string message) {
  81. return OnDebugFatal(message);
  82. }
  83. public delegate int SwigDelegateDDebugCallback_0(string message);
  84. public delegate int SwigDelegateDDebugCallback_1(string message);
  85. public delegate int SwigDelegateDDebugCallback_2(string message);
  86. public delegate int SwigDelegateDDebugCallback_3(string message);
  87. private SwigDelegateDDebugCallback_0 swigDelegate0;
  88. private SwigDelegateDDebugCallback_1 swigDelegate1;
  89. private SwigDelegateDDebugCallback_2 swigDelegate2;
  90. private SwigDelegateDDebugCallback_3 swigDelegate3;
  91. private static Type[] swigMethodTypes0 = new Type[] { typeof(string) };
  92. private static Type[] swigMethodTypes1 = new Type[] { typeof(string) };
  93. private static Type[] swigMethodTypes2 = new Type[] { typeof(string) };
  94. private static Type[] swigMethodTypes3 = new Type[] { typeof(string) };
  95. }
  96. }