UnsignedShortPointer.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 UnsignedShortPointer : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal UnsignedShortPointer(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(UnsignedShortPointer obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~UnsignedShortPointer() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. RakNetPINVOKE.delete_UnsignedShortPointer(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public UnsignedShortPointer() : this(RakNetPINVOKE.new_UnsignedShortPointer(), true) {
  37. }
  38. public void assign(ushort value) {
  39. RakNetPINVOKE.UnsignedShortPointer_assign(swigCPtr, value);
  40. }
  41. public ushort value() {
  42. ushort ret = RakNetPINVOKE.UnsignedShortPointer_value(swigCPtr);
  43. return ret;
  44. }
  45. public SWIGTYPE_p_unsigned_short cast() {
  46. IntPtr cPtr = RakNetPINVOKE.UnsignedShortPointer_cast(swigCPtr);
  47. SWIGTYPE_p_unsigned_short ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_short(cPtr, false);
  48. return ret;
  49. }
  50. public static UnsignedShortPointer frompointer(SWIGTYPE_p_unsigned_short t) {
  51. IntPtr cPtr = RakNetPINVOKE.UnsignedShortPointer_frompointer(SWIGTYPE_p_unsigned_short.getCPtr(t));
  52. UnsignedShortPointer ret = (cPtr == IntPtr.Zero) ? null : new UnsignedShortPointer(cPtr, false);
  53. return ret;
  54. }
  55. }
  56. }
粤ICP备19079148号