Extended .NET SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdTfDigestMap.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.TD {
12
13using System;
14using System.Runtime.InteropServices;
15using Teigha.Core;
16
17public class OdTfDigestMap : global::System.IDisposable
18 , global::System.Collections.Generic.IDictionary<String, OdTfDigest>
19 {
20 private Object locker = new Object();
21 private HandleRef swigCPtr;
22 protected bool swigCMemOwn;
23 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
24 public OdTfDigestMap(IntPtr cPtr, bool cMemoryOwn) {
25 swigCMemOwn = cMemoryOwn;
26 swigCPtr = new HandleRef(this, cPtr);
27 }
28 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
29 public static HandleRef getCPtr(OdTfDigestMap obj) {
30 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
31 }
32
34 Dispose(false);
35 }
36
37 public void Dispose() {
38 Dispose(true);
39 global::System.GC.SuppressFinalize(this);
40 }
41
42 protected virtual void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 }
52 }
53
54
55 public OdTfDigest this[String key] {
56 get {
57 return getitem(key);
58 }
59
60 set {
61 setitem(key, value);
62 }
63 }
64
65 public bool TryGetValue(String key, out OdTfDigest value) {
66 if (this.ContainsKey(key)) {
67 value = this[key];
68 return true;
69 }
70 value = default(OdTfDigest);
71 return false;
72 }
73
74 public int Count {
75 get {
76 return (int)size();
77 }
78 }
79
80 public bool IsReadOnly {
81 get {
82 return false;
83 }
84 }
85
86 public global::System.Collections.Generic.ICollection<String> Keys {
87 get {
88 global::System.Collections.Generic.ICollection<String> keys = new global::System.Collections.Generic.List<String>();
89 int size = this.Count;
90 if (size > 0) {
91 global::System.IntPtr iter = create_iterator_begin();
92 for (int i = 0; i < size; i++) {
93 keys.Add(get_next_key(iter));
94 }
95 destroy_iterator(iter);
96 }
97 return keys;
98 }
99 }
100
101 public global::System.Collections.Generic.ICollection<OdTfDigest> Values {
102 get {
103 global::System.Collections.Generic.ICollection<OdTfDigest> vals = new global::System.Collections.Generic.List<OdTfDigest>();
104 foreach (global::System.Collections.Generic.KeyValuePair<String, OdTfDigest> pair in this) {
105 vals.Add(pair.Value);
106 }
107 return vals;
108 }
109 }
110
111 public void Add(global::System.Collections.Generic.KeyValuePair<String, OdTfDigest> item) {
112 Add(item.Key, item.Value);
113 }
114
115 public bool Remove(global::System.Collections.Generic.KeyValuePair<String, OdTfDigest> item) {
116 if (Contains(item)) {
117 return Remove(item.Key);
118 } else {
119 return false;
120 }
121 }
122
123 public bool Contains(global::System.Collections.Generic.KeyValuePair<String, OdTfDigest> item) {
124 if (this[item.Key] == item.Value) {
125 return true;
126 } else {
127 return false;
128 }
129 }
130
131 public void CopyTo(global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>[] array) {
132 CopyTo(array, 0);
133 }
134
135 public void CopyTo(global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>[] array, int arrayIndex) {
136 if (array == null)
137 throw new global::System.ArgumentNullException("array");
138 if (arrayIndex < 0)
139 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
140 if (array.Rank > 1)
141 throw new global::System.ArgumentException("Multi dimensional array.", "array");
142 if (arrayIndex+this.Count > array.Length)
143 throw new global::System.ArgumentException("Number of elements to copy is too large.");
144
145 global::System.Collections.Generic.IList<String> keyList = new global::System.Collections.Generic.List<String>(this.Keys);
146 for (int i = 0; i < keyList.Count; i++) {
147 String currentKey = keyList[i];
148 array.SetValue(new global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>(currentKey, this[currentKey]), arrayIndex+i);
149 }
150 }
151
152 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>> global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>>.GetEnumerator() {
153 return new OdTfDigestMapEnumerator(this);
154 }
155
156 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
157 return new OdTfDigestMapEnumerator(this);
158 }
159
161 return new OdTfDigestMapEnumerator(this);
162 }
163
164 // Type-safe enumerator
169 public class OdTfDigestMapEnumerator : global::System.Collections.IEnumerator,
170 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>>
171 {
172 private OdTfDigestMap collectionRef;
173 private global::System.Collections.Generic.IList<String> keyCollection;
174 private int currentIndex;
175 private object currentObject;
176 private int currentSize;
177
179 collectionRef = collection;
180 keyCollection = new global::System.Collections.Generic.List<String>(collection.Keys);
181 currentIndex = -1;
182 currentObject = null;
183 currentSize = collectionRef.Count;
184 }
185
186 // Type-safe iterator Current
187 public global::System.Collections.Generic.KeyValuePair<String, OdTfDigest> Current {
188 get {
189 if (currentIndex == -1)
190 throw new global::System.InvalidOperationException("Enumeration not started.");
191 if (currentIndex > currentSize - 1)
192 throw new global::System.InvalidOperationException("Enumeration finished.");
193 if (currentObject == null)
194 throw new global::System.InvalidOperationException("Collection modified.");
195 return (global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>)currentObject;
196 }
197 }
198
199 // Type-unsafe IEnumerator.Current
200 object global::System.Collections.IEnumerator.Current {
201 get {
202 return Current;
203 }
204 }
205
206 public bool MoveNext() {
207 int size = collectionRef.Count;
208 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
209 if (moveOkay) {
210 currentIndex++;
211 String currentKey = keyCollection[currentIndex];
212 currentObject = new global::System.Collections.Generic.KeyValuePair<String, OdTfDigest>(currentKey, collectionRef[currentKey]);
213 } else {
214 currentObject = null;
215 }
216 return moveOkay;
217 }
218
219 public void Reset() {
220 currentIndex = -1;
221 currentObject = null;
222 if (collectionRef.Count != currentSize) {
223 throw new global::System.InvalidOperationException("Collection modified.");
224 }
225 }
226
227 public void Dispose() {
228 currentIndex = -1;
229 currentObject = null;
230 }
231 }
232
233
234 public OdTfDigestMap() : this(TD_DbPINVOKE.new_OdTfDigestMap__SWIG_0(), true) {
236 }
237
238 public OdTfDigestMap(OdTfDigestMap other) : this(TD_DbPINVOKE.new_OdTfDigestMap__SWIG_1(OdTfDigestMap.getCPtr(other)), true) {
240 }
241
242 private uint size() {
243 uint ret = TD_DbPINVOKE.OdTfDigestMap_size(swigCPtr);
245 return ret;
246 }
247
248 public bool empty() {
249 bool ret = TD_DbPINVOKE.OdTfDigestMap_empty(swigCPtr);
251 return ret;
252 }
253
254 public void Clear() {
257 }
258
259 private OdTfDigest getitem(String key) {
260 OdTfDigest ret = new OdTfDigest(TD_DbPINVOKE.OdTfDigestMap_getitem(swigCPtr, key), false);
262 return ret;
263 }
264
265 private void setitem(String key, OdTfDigest x) {
266 TD_DbPINVOKE.OdTfDigestMap_setitem(swigCPtr, key, OdTfDigest.getCPtr(x));
267 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
268 }
269
270 public bool ContainsKey(String key) {
271 bool ret = TD_DbPINVOKE.OdTfDigestMap_ContainsKey(swigCPtr, key);
273 return ret;
274 }
275
276 public void Add(String key, OdTfDigest value) {
279 }
280
281 public bool Remove(String key) {
282 bool ret = TD_DbPINVOKE.OdTfDigestMap_Remove(swigCPtr, key);
284 return ret;
285 }
286
287 private global::System.IntPtr create_iterator_begin() {
288 global::System.IntPtr ret = TD_DbPINVOKE.OdTfDigestMap_create_iterator_begin(swigCPtr);
290 return ret;
291 }
292
293 private String get_next_key(global::System.IntPtr swigiterator) {
294 string ret = TD_DbPINVOKE.OdTfDigestMap_get_next_key(swigCPtr, swigiterator);
295 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
296 return ret;
297}
298
299 private void destroy_iterator(global::System.IntPtr swigiterator) {
300 TD_DbPINVOKE.OdTfDigestMap_destroy_iterator(swigCPtr, swigiterator);
301 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
302 }
303
304}
305
306}
static HandleRef getCPtr(OdTfDigest obj)
Definition: OdTfDigest.cs:27
global::System.Collections.Generic.KeyValuePair< String, OdTfDigest > Current
OdTfDigestMapEnumerator(OdTfDigestMap collection)
bool ContainsKey(String key)
virtual void Dispose(bool disposing)
bool Remove(String key)
bool Contains(global::System.Collections.Generic.KeyValuePair< String, OdTfDigest > item)
bool TryGetValue(String key, out OdTfDigest value)
OdTfDigestMap(IntPtr cPtr, bool cMemoryOwn)
global::System.Collections.Generic.ICollection< String > Keys
void Add(String key, OdTfDigest value)
void Add(global::System.Collections.Generic.KeyValuePair< String, OdTfDigest > item)
static HandleRef getCPtr(OdTfDigestMap obj)
void CopyTo(global::System.Collections.Generic.KeyValuePair< String, OdTfDigest >[] array)
OdTfDigestMapEnumerator GetEnumerator()
bool Remove(global::System.Collections.Generic.KeyValuePair< String, OdTfDigest > item)
OdTfDigestMap(OdTfDigestMap other)
global::System.Collections.Generic.ICollection< OdTfDigest > Values
void CopyTo(global::System.Collections.Generic.KeyValuePair< String, OdTfDigest >[] array, int arrayIndex)
static global::System.Exception Retrieve()
static void delete_OdTfDigestMap(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool OdTfDigestMap_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static void OdTfDigestMap_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr OdTfDigestMap_create_iterator_begin(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool OdTfDigestMap_empty(global::System.Runtime.InteropServices.HandleRef jarg1)
static void OdTfDigestMap_Add(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static global::System.IntPtr OdTfDigestMap_getitem(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static bool OdTfDigestMap_ContainsKey(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static uint OdTfDigestMap_size(global::System.Runtime.InteropServices.HandleRef jarg1)