Extended .NET SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdVectorOdUInt8.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (http://www.swig.org).
5// Version 4.0.2
6//
7// Do not make changes to this file unless you know what you are doing--modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
11namespace Teigha.Core {
12
13using System;
14using System.Runtime.InteropServices;
15
16public class OdVectorOdUInt8 : IDisposable, System.Collections.IEnumerable
17, System.Collections.Generic.IList<byte /*SIMPLETYPE*/>
18 {
19 private Object locker = new Object();
20 private HandleRef swigCPtr;
21 protected bool swigCMemOwn;
22 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
23 public OdVectorOdUInt8(IntPtr cPtr, bool cMemoryOwn) {
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new HandleRef(this, cPtr);
26 }
27 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
28 public static HandleRef getCPtr(OdVectorOdUInt8 obj) {
29 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
30 }
31
33 Dispose(false);
34 }
35
36 public void Dispose() {
37 Dispose(true);
38 global::System.GC.SuppressFinalize(this);
39 }
40
41 protected virtual void Dispose(bool disposing) {
42 lock(this) {
43 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
44 if (swigCMemOwn) {
45 swigCMemOwn = false;
47 }
48 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
49 }
50 }
51 }
52
53// ctors
54 public OdVectorOdUInt8(System.Collections.ICollection c) : this() {
55 if (c == null)
56 throw new ArgumentNullException("c");
57 foreach (byte /*SIMPLETYPE*/ element in c) {
58 this.Add(element);
59 }
60 }
61
63 : this(GlobalsPINVOKE.new_OdVectorOdUInt8__SWIG_0(), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null)
64 {
65 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #9
66 if (null != mTr)
67 {
68 mTr.AddObject(new OdVectorOdUInt8(swigCPtr.Handle, true));
69 }
71 }
72
73 public OdVectorOdUInt8(OdVectorOdUInt8 other) : this(GlobalsPINVOKE.new_OdVectorOdUInt8__SWIG_1(OdVectorOdUInt8.getCPtr(other)), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null) {
74 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #10
75 if (null != mTr)
76 {
77 mTr.AddObject(new OdVectorOdUInt8(swigCPtr.Handle, true));
78 }
80 }
81
82 public OdVectorOdUInt8(int capacity) : this(GlobalsPINVOKE.new_OdVectorOdUInt8__SWIG_2(capacity), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null) {
83 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #11
84 if (null != mTr)
85 {
86 mTr.AddObject(new OdVectorOdUInt8(swigCPtr.Handle, true));
87 }
89 }
90
91// methods
92 public bool IsFixedSize {
93 get {
94 return false;
95 }
96 }
97
98 public bool IsReadOnly {
99 get {
100 return false;
101 }
102 }
103
104 public byte /*SIMPLETYPE*/ this[int index] {
105 get {
106 return getitem(index);
107 }
108 set {
109 setitem(index, value);
110 }
111 }
112
113 public int Capacity {
114 get {
115 return (int)capacity();
116 }
117 set {
118 if (value < size())
119 throw new ArgumentOutOfRangeException("Capacity");
120 reserve((uint)value);
121 }
122 }
123
124 public int Count {
125 get {
126 return (int)size();
127 }
128 }
129
130 public bool IsSynchronized {
131 get {
132 return false;
133 }
134 }
135
136 public void CopyTo(byte /*SIMPLETYPE*/[] array)
137 {
138 CopyTo(0, array, 0, this.Count);
139 }
140
141 public void CopyTo(byte /*SIMPLETYPE*/[] array, int arrayIndex)
142 {
143 CopyTo(0, array, arrayIndex, this.Count);
144 }
145
146 public void CopyTo(int index, byte /*SIMPLETYPE*/[] array, int arrayIndex, int count)
147 {
148 if (array == null)
149 throw new ArgumentNullException("array");
150 if (index < 0)
151 throw new ArgumentOutOfRangeException("index", "Value is less than zero");
152 if (arrayIndex < 0)
153 throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
154 if (count < 0)
155 throw new ArgumentOutOfRangeException("count", "Value is less than zero");
156 if (array.Rank > 1)
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);
162 }
163
164 System.Collections.Generic.IEnumerator<byte /*SIMPLETYPE*/> System.Collections.Generic.IEnumerable<byte /*SIMPLETYPE*/>.GetEnumerator() {
165 return new OdVectorOdUInt8Enumerator(this);
166 }
167
168 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
169 return new OdVectorOdUInt8Enumerator(this);
170 }
171
173 return new OdVectorOdUInt8Enumerator(this);
174 }
175
176 // Type-safe enumerator
181 public class OdVectorOdUInt8Enumerator : System.Collections.IEnumerator
182 , System.Collections.Generic.IEnumerator<byte /*SIMPLETYPE*/>
183 {
184 private OdVectorOdUInt8 collectionRef;
185 private int currentIndex;
186 private object currentObject;
187 private int currentSize;
188
190 collectionRef = collection;
191 currentIndex = -1;
192 currentObject = null;
193 currentSize = collectionRef.Count;
194 }
195
196 // Type-safe iterator Current
197 public byte /*SIMPLETYPE*/ Current {
198 get {
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.");
205 return (byte /*SIMPLETYPE*/)currentObject;
206 }
207 }
208
209 // Type-unsafe IEnumerator.Current
210 object System.Collections.IEnumerator.Current {
211 get {
212 return Current;
213 }
214 }
215
216 public bool MoveNext() {
217 int size = collectionRef.Count;
218 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
219 if (moveOkay) {
220 currentIndex++;
221 currentObject = collectionRef[currentIndex];
222 } else {
223 currentObject = null;
224 }
225 return moveOkay;
226 }
227
228 public void Reset() {
229 currentIndex = -1;
230 currentObject = null;
231 if (collectionRef.Count != currentSize) {
232 throw new InvalidOperationException("Collection modified.");
233 }
234 }
235
236 public void Dispose() {
237 currentIndex = -1;
238 currentObject = null;
239 }
240 }
241
242 public void Clear() {
245 }
246
247 public void Add(byte /*SIMPLETYPE cstype*/ x) {
248 GlobalsPINVOKE.OdVectorOdUInt8_Add(swigCPtr, x /*SIMPLETYPE csin*/);
250 }
251
252 private uint size() {
253 uint ret = GlobalsPINVOKE.OdVectorOdUInt8_size(swigCPtr);
255 return ret;
256 }
257
258 private uint capacity() {
259 uint ret = GlobalsPINVOKE.OdVectorOdUInt8_capacity(swigCPtr);
260 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
261 return ret;
262 }
263
264 private void reserve(uint n) {
265 GlobalsPINVOKE.OdVectorOdUInt8_reserve(swigCPtr, n);
266 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
267 }
268
269 public void resize(uint logicalLength) {
270 GlobalsPINVOKE.OdVectorOdUInt8_resize(swigCPtr, logicalLength);
272 }
273
274 private byte getitemcopy(int index) {
275// test csout
276 /*SIMPLETYPE*/
277 byte ret = GlobalsPINVOKE.OdVectorOdUInt8_getitemcopy(swigCPtr, index);
279 return ret;
280 }
281
282 private byte /*SIMPLETYPE cstype*/ getitem(int index) {
283// test csout
284 /*SIMPLETYPE csout*/
285 byte ret = GlobalsPINVOKE.OdVectorOdUInt8_getitem(swigCPtr, index);
286 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
287 return ret;
288 }
289
290 private void setitem(int index, byte /*SIMPLETYPE cstype*/ val) {
291 GlobalsPINVOKE.OdVectorOdUInt8_setitem(swigCPtr, index, val /*SIMPLETYPE csin*/);
292 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
293 }
294
295 public void AddRange(OdVectorOdUInt8 values) {
298 }
299
300 public OdVectorOdUInt8 GetRange(int index, int count) {
301 global::System.IntPtr cPtr = GlobalsPINVOKE.OdVectorOdUInt8_GetRange(swigCPtr, index, count);
302 OdVectorOdUInt8 ret = (cPtr == global::System.IntPtr.Zero) ? null : new OdVectorOdUInt8(cPtr, false);
304 return ret;
305 }
306
307 public void Insert(int index, byte /*SIMPLETYPE cstype*/ x) {
308 GlobalsPINVOKE.OdVectorOdUInt8_Insert(swigCPtr, index, x /*SIMPLETYPE csin*/);
310 }
311
312 public void InsertRange(int index, OdVectorOdUInt8 values) {
315 }
316
317 public void RemoveAt(int index) {
320 }
321
322 public void RemoveRange(int index, int count) {
323 GlobalsPINVOKE.OdVectorOdUInt8_RemoveRange(swigCPtr, index, count);
325 }
326
327 public static OdVectorOdUInt8 Repeat(byte /*SIMPLETYPE cstype*/ value, int count) {
328 global::System.IntPtr cPtr = GlobalsPINVOKE.OdVectorOdUInt8_Repeat(value /*SIMPLETYPE csin*/, count);
329 OdVectorOdUInt8 ret = (cPtr == global::System.IntPtr.Zero) ? null : new OdVectorOdUInt8(cPtr, true);
331 return ret;
332 }
333
334 public void Reverse() {
337 }
338
339 public void Reverse(int index, int count) {
340 GlobalsPINVOKE.OdVectorOdUInt8_Reverse__SWIG_1(swigCPtr, index, count);
342 }
343
344 public void SetRange(int index, OdVectorOdUInt8 values) {
347 }
348
349 public bool Contains(byte /*SIMPLETYPE cstype*/ value) {
350 bool ret = GlobalsPINVOKE.OdVectorOdUInt8_Contains(swigCPtr, value /*SIMPLETYPE csin*/);
352 return ret;
353 }
354
355 public int IndexOf(byte /*SIMPLETYPE cstype*/ value) {
356 int ret = GlobalsPINVOKE.OdVectorOdUInt8_IndexOf(swigCPtr, value /*SIMPLETYPE csin*/);
358 return ret;
359 }
360
361 public int LastIndexOf(byte /*SIMPLETYPE cstype*/ value) {
362 int ret = GlobalsPINVOKE.OdVectorOdUInt8_LastIndexOf(swigCPtr, value /*SIMPLETYPE csin*/);
364 return ret;
365 }
366
367 public bool Remove(byte /*SIMPLETYPE cstype*/ value) {
368 bool ret = GlobalsPINVOKE.OdVectorOdUInt8_Remove(swigCPtr, value /*SIMPLETYPE csin*/);
370 return ret;
371 }
372
373}
374
375}
static global::System.Exception Retrieve()
static void OdVectorOdUInt8_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void OdVectorOdUInt8_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static void OdVectorOdUInt8_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, byte jarg3)
static void OdVectorOdUInt8_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool OdVectorOdUInt8_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2)
static uint OdVectorOdUInt8_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static int OdVectorOdUInt8_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2)
static void delete_OdVectorOdUInt8(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr OdVectorOdUInt8_Repeat(byte jarg1, int jarg2)
static void OdVectorOdUInt8_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void OdVectorOdUInt8_Add(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2)
static global::System.IntPtr OdVectorOdUInt8_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void OdVectorOdUInt8_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void OdVectorOdUInt8_resize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2)
static byte OdVectorOdUInt8_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void OdVectorOdUInt8_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static bool OdVectorOdUInt8_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2)
static void OdVectorOdUInt8_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static int OdVectorOdUInt8_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2)
static void OdVectorOdUInt8_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
void Insert(int index, byte x)
void CopyTo(byte[] array, int arrayIndex)
static HandleRef getCPtr(OdVectorOdUInt8 obj)
OdVectorOdUInt8(System.Collections.ICollection c)
void InsertRange(int index, OdVectorOdUInt8 values)
virtual void Dispose(bool disposing)
void Reverse(int index, int count)
static OdVectorOdUInt8 Repeat(byte value, int count)
void resize(uint logicalLength)
OdVectorOdUInt8 GetRange(int index, int count)
void RemoveRange(int index, int count)
OdVectorOdUInt8Enumerator GetEnumerator()
void CopyTo(int index, byte[] array, int arrayIndex, int count)
void SetRange(int index, OdVectorOdUInt8 values)
void AddRange(OdVectorOdUInt8 values)
OdVectorOdUInt8(IntPtr cPtr, bool cMemoryOwn)
OdVectorOdUInt8(OdVectorOdUInt8 other)