14using System.Runtime.InteropServices;
19, System.Collections.Generic.IList<OdRxClass>
21 private Object locker =
new Object();
22 private HandleRef swigCPtr;
24 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
27 swigCPtr =
new HandleRef(
this, cPtr);
29 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
31 return (obj ==
null) ?
new HandleRef(
null, IntPtr.Zero) : obj.swigCPtr;
40 global::System.GC.SuppressFinalize(
this);
43 protected virtual void Dispose(
bool disposing) {
45 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
50 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
57 throw new ArgumentNullException(
"c");
64 : this(
PCADGlobalsPINVOKE.new_ClassPtrArray__SWIG_0(), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null)
66 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction();
75 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction();
83 public ClassPtrArray(
int capacity) : this(
PCADGlobalsPINVOKE.new_ClassPtrArray__SWIG_2(capacity), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null) {
84 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction();
106 return getitem(index);
109 setitem(index,
value);
115 return (
int)capacity();
119 throw new ArgumentOutOfRangeException(
"Capacity");
120 reserve((uint)
value);
149 throw new ArgumentNullException(
"array");
151 throw new ArgumentOutOfRangeException(
"index",
"Value is less than zero");
153 throw new ArgumentOutOfRangeException(
"arrayIndex",
"Value is less than zero");
155 throw new ArgumentOutOfRangeException(
"count",
"Value is less than zero");
157 throw new ArgumentException(
"Multi dimensional array.",
"array");
158 if (index+count > this.
Count || arrayIndex+count > array.Length)
159 throw new ArgumentException(
"Number of elements to copy is too large.");
160 for (
int i=0; i<count; i++)
161 array.SetValue(getitemcopy(index+i), arrayIndex+i);
164 System.Collections.Generic.IEnumerator<
OdRxClass> System.Collections.Generic.IEnumerable<
OdRxClass>.GetEnumerator() {
165 return new ClassPtrArrayEnumerator(
this);
168 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
169 return new ClassPtrArrayEnumerator(
this);
182 , System.Collections.Generic.IEnumerator<OdRxClass>
185 private int currentIndex;
186 private object currentObject;
187 private int currentSize;
190 collectionRef = collection;
192 currentObject =
null;
193 currentSize = collectionRef.
Count;
199 if (currentIndex == -1)
200 throw new InvalidOperationException(
"Enumeration not started.");
201 if (currentIndex > currentSize - 1)
202 throw new InvalidOperationException(
"Enumeration finished.");
203 if (currentObject ==
null)
204 throw new InvalidOperationException(
"Collection modified.");
210 object System.Collections.IEnumerator.Current {
217 int size = collectionRef.
Count;
218 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
221 currentObject = collectionRef[currentIndex];
223 currentObject =
null;
230 currentObject =
null;
231 if (collectionRef.
Count != currentSize) {
232 throw new InvalidOperationException(
"Collection modified.");
238 currentObject =
null;
252 private uint size() {
258 private uint capacity() {
259 uint ret = PCADGlobalsPINVOKE.ClassPtrArray_capacity(swigCPtr);
260 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending)
throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
264 private void reserve(uint n) {
265 PCADGlobalsPINVOKE.ClassPtrArray_reserve(swigCPtr, n);
266 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending)
throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
274 private OdRxClass getitemcopy(
int index) {
282 global::System.IntPtr cPtr = PCADGlobalsPINVOKE.ClassPtrArray_getitem(swigCPtr, index);
283 OdRxClass ret = (cPtr == global::System.IntPtr.Zero) ?
null :
new OdRxClass(cPtr,
false);
284 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending)
throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
288 private void setitem(
int index,
OdRxClass val) {
289 PCADGlobalsPINVOKE.ClassPtrArray_setitem(swigCPtr, index,
OdRxClass.
getCPtr(val));
290 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending)
throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
ClassPtrArrayEnumerator(ClassPtrArray collection)
static HandleRef getCPtr(ClassPtrArray obj)
void CopyTo(int index, OdRxClass[] array, int arrayIndex, int count)
void RemoveRange(int index, int count)
void Reverse(int index, int count)
ClassPtrArray(System.Collections.ICollection c)
void AddRange(ClassPtrArray values)
int IndexOf(OdRxClass value)
static ClassPtrArray Repeat(OdRxClass value, int count)
ClassPtrArray GetRange(int index, int count)
virtual void Dispose(bool disposing)
int LastIndexOf(OdRxClass value)
ClassPtrArray(ClassPtrArray other)
bool Remove(OdRxClass value)
void CopyTo(OdRxClass[] array)
void InsertRange(int index, ClassPtrArray values)
ClassPtrArray(IntPtr cPtr, bool cMemoryOwn)
void Insert(int index, OdRxClass x)
void CopyTo(OdRxClass[] array, int arrayIndex)
void SetRange(int index, ClassPtrArray values)
ClassPtrArray(int capacity)
ClassPtrArrayEnumerator GetEnumerator()
void resize(uint logicalLength)
bool Contains(OdRxClass value)
static global::System.Exception Retrieve()
static void ClassPtrArray_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int ClassPtrArray_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void delete_ClassPtrArray(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr ClassPtrArray_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool ClassPtrArray_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int ClassPtrArray_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr ClassPtrArray_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ClassPtrArray_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void ClassPtrArray_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool ClassPtrArray_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static IntPtr ClassPtrArray_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ClassPtrArray_resize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2)
static uint ClassPtrArray_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static HandleRef getCPtr(OdRxClass obj)