ReadyEvent.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  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 RakNet {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class ReadyEvent : PluginInterface2 {
  12. private HandleRef swigCPtr;
  13. internal ReadyEvent(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.ReadyEvent_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(ReadyEvent obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~ReadyEvent() {
  20. Dispose();
  21. }
  22. public override void Dispose() {
  23. lock(this) {
  24. if (swigCPtr.Handle != IntPtr.Zero) {
  25. if (swigCMemOwn) {
  26. swigCMemOwn = false;
  27. RakNetPINVOKE.delete_ReadyEvent(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public static ReadyEvent GetInstance() {
  36. IntPtr cPtr = RakNetPINVOKE.ReadyEvent_GetInstance();
  37. ReadyEvent ret = (cPtr == IntPtr.Zero) ? null : new ReadyEvent(cPtr, false);
  38. return ret;
  39. }
  40. public static void DestroyInstance(ReadyEvent i) {
  41. RakNetPINVOKE.ReadyEvent_DestroyInstance(ReadyEvent.getCPtr(i));
  42. }
  43. public ReadyEvent() : this(RakNetPINVOKE.new_ReadyEvent(), true) {
  44. }
  45. public bool SetEvent(int eventId, bool isReady) {
  46. bool ret = RakNetPINVOKE.ReadyEvent_SetEvent(swigCPtr, eventId, isReady);
  47. return ret;
  48. }
  49. public bool ForceCompletion(int eventId) {
  50. bool ret = RakNetPINVOKE.ReadyEvent_ForceCompletion(swigCPtr, eventId);
  51. return ret;
  52. }
  53. public bool DeleteEvent(int eventId) {
  54. bool ret = RakNetPINVOKE.ReadyEvent_DeleteEvent(swigCPtr, eventId);
  55. return ret;
  56. }
  57. public bool IsEventSet(int eventId) {
  58. bool ret = RakNetPINVOKE.ReadyEvent_IsEventSet(swigCPtr, eventId);
  59. return ret;
  60. }
  61. public bool IsEventCompletionProcessing(int eventId) {
  62. bool ret = RakNetPINVOKE.ReadyEvent_IsEventCompletionProcessing(swigCPtr, eventId);
  63. return ret;
  64. }
  65. public bool IsEventCompleted(int eventId) {
  66. bool ret = RakNetPINVOKE.ReadyEvent_IsEventCompleted(swigCPtr, eventId);
  67. return ret;
  68. }
  69. public bool HasEvent(int eventId) {
  70. bool ret = RakNetPINVOKE.ReadyEvent_HasEvent(swigCPtr, eventId);
  71. return ret;
  72. }
  73. public uint GetEventListSize() {
  74. uint ret = RakNetPINVOKE.ReadyEvent_GetEventListSize(swigCPtr);
  75. return ret;
  76. }
  77. public int GetEventAtIndex(uint index) {
  78. int ret = RakNetPINVOKE.ReadyEvent_GetEventAtIndex(swigCPtr, index);
  79. return ret;
  80. }
  81. public bool AddToWaitList(int eventId, SystemAddress address) {
  82. bool ret = RakNetPINVOKE.ReadyEvent_AddToWaitList(swigCPtr, eventId, SystemAddress.getCPtr(address));
  83. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  84. return ret;
  85. }
  86. public bool RemoveFromWaitList(int eventId, SystemAddress address) {
  87. bool ret = RakNetPINVOKE.ReadyEvent_RemoveFromWaitList(swigCPtr, eventId, SystemAddress.getCPtr(address));
  88. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  89. return ret;
  90. }
  91. public bool IsInWaitList(int eventId, SystemAddress address) {
  92. bool ret = RakNetPINVOKE.ReadyEvent_IsInWaitList(swigCPtr, eventId, SystemAddress.getCPtr(address));
  93. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  94. return ret;
  95. }
  96. public uint GetRemoteWaitListSize(int eventId) {
  97. uint ret = RakNetPINVOKE.ReadyEvent_GetRemoteWaitListSize(swigCPtr, eventId);
  98. return ret;
  99. }
  100. public SystemAddress GetFromWaitListAtIndex(int eventId, uint index) {
  101. SystemAddress ret = new SystemAddress(RakNetPINVOKE.ReadyEvent_GetFromWaitListAtIndex(swigCPtr, eventId, index), true);
  102. return ret;
  103. }
  104. public ReadyEventSystemStatus GetReadyStatus(int eventId, SystemAddress address) {
  105. ReadyEventSystemStatus ret = (ReadyEventSystemStatus)RakNetPINVOKE.ReadyEvent_GetReadyStatus(swigCPtr, eventId, SystemAddress.getCPtr(address));
  106. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  107. return ret;
  108. }
  109. public void SetSendChannel(byte newChannel) {
  110. RakNetPINVOKE.ReadyEvent_SetSendChannel(swigCPtr, newChannel);
  111. }
  112. }
  113. }
粤ICP备19079148号