RakNetListCell.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 RakNetListCell : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal RakNetListCell(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(RakNetListCell obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~RakNetListCell() {
  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_RakNetListCell(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public Cell this[int index]
  37. {
  38. get
  39. {
  40. return Get((uint)index); // use indexto retrieve and return another value.
  41. }
  42. set
  43. {
  44. Replace(value, value, (uint)index, "Not used", 0);// use index and value to set the value somewhere.
  45. }
  46. }
  47. public RakNetListCell() : this(RakNetPINVOKE.new_RakNetListCell__SWIG_0(), true) {
  48. }
  49. public RakNetListCell(RakNetListCell original_copy) : this(RakNetPINVOKE.new_RakNetListCell__SWIG_1(RakNetListCell.getCPtr(original_copy)), true) {
  50. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  51. }
  52. public RakNetListCell CopyData(RakNetListCell original_copy) {
  53. RakNetListCell ret = new RakNetListCell(RakNetPINVOKE.RakNetListCell_CopyData(swigCPtr, RakNetListCell.getCPtr(original_copy)), false);
  54. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  55. return ret;
  56. }
  57. public Cell Get(uint position) {
  58. Cell ret = new Cell(RakNetPINVOKE.RakNetListCell_Get(swigCPtr, position), false);
  59. return ret;
  60. }
  61. public void Push(Cell input, string file, uint line) {
  62. RakNetPINVOKE.RakNetListCell_Push(swigCPtr, Cell.getCPtr(input), file, line);
  63. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  64. }
  65. public Cell Pop() {
  66. Cell ret = new Cell(RakNetPINVOKE.RakNetListCell_Pop(swigCPtr), false);
  67. return ret;
  68. }
  69. public void Insert(Cell input, uint position, string file, uint line) {
  70. RakNetPINVOKE.RakNetListCell_Insert__SWIG_0(swigCPtr, Cell.getCPtr(input), position, file, line);
  71. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  72. }
  73. public void Insert(Cell input, string file, uint line) {
  74. RakNetPINVOKE.RakNetListCell_Insert__SWIG_1(swigCPtr, Cell.getCPtr(input), file, line);
  75. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  76. }
  77. public void Replace(Cell input, Cell filler, uint position, string file, uint line) {
  78. RakNetPINVOKE.RakNetListCell_Replace__SWIG_0(swigCPtr, Cell.getCPtr(input), Cell.getCPtr(filler), position, file, line);
  79. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  80. }
  81. public void Replace(Cell input) {
  82. RakNetPINVOKE.RakNetListCell_Replace__SWIG_1(swigCPtr, Cell.getCPtr(input));
  83. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  84. }
  85. public void RemoveAtIndex(uint position) {
  86. RakNetPINVOKE.RakNetListCell_RemoveAtIndex(swigCPtr, position);
  87. }
  88. public void RemoveAtIndexFast(uint position) {
  89. RakNetPINVOKE.RakNetListCell_RemoveAtIndexFast(swigCPtr, position);
  90. }
  91. public void RemoveFromEnd(uint num) {
  92. RakNetPINVOKE.RakNetListCell_RemoveFromEnd__SWIG_0(swigCPtr, num);
  93. }
  94. public void RemoveFromEnd() {
  95. RakNetPINVOKE.RakNetListCell_RemoveFromEnd__SWIG_1(swigCPtr);
  96. }
  97. public uint Size() {
  98. uint ret = RakNetPINVOKE.RakNetListCell_Size(swigCPtr);
  99. return ret;
  100. }
  101. public void Clear(bool doNotDeallocateSmallBlocks, string file, uint line) {
  102. RakNetPINVOKE.RakNetListCell_Clear(swigCPtr, doNotDeallocateSmallBlocks, file, line);
  103. }
  104. public void Preallocate(uint countNeeded, string file, uint line) {
  105. RakNetPINVOKE.RakNetListCell_Preallocate(swigCPtr, countNeeded, file, line);
  106. }
  107. public void Compress(string file, uint line) {
  108. RakNetPINVOKE.RakNetListCell_Compress(swigCPtr, file, line);
  109. }
  110. }
  111. }
粤ICP备19079148号