14using System.Runtime.InteropServices;
17 , global::System.Collections.Generic.IDictionary<ulong, ulong>
19 private Object locker =
new Object();
20 private HandleRef swigCPtr;
22 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
25 swigCPtr =
new HandleRef(
this, cPtr);
27 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
29 return (obj ==
null) ?
new HandleRef(
null, IntPtr.Zero) : obj.swigCPtr;
38 global::System.GC.SuppressFinalize(
this);
41 protected virtual void Dispose(
bool disposing) {
43 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
48 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
54 public ulong
this[ulong key] {
69 value =
default(ulong);
85 public global::System.Collections.Generic.ICollection<ulong>
Keys {
87 global::System.Collections.Generic.ICollection<ulong> keys =
new global::System.Collections.Generic.List<ulong>();
88 int size = this.
Count;
90 global::System.IntPtr iter = create_iterator_begin();
91 for (
int i = 0; i < size; i++) {
92 keys.Add(get_next_key(iter));
94 destroy_iterator(iter);
100 public global::System.Collections.Generic.ICollection<ulong>
Values {
102 global::System.Collections.Generic.ICollection<ulong> vals =
new global::System.Collections.Generic.List<ulong>();
103 foreach (global::System.Collections.Generic.KeyValuePair<ulong, ulong> pair in
this) {
104 vals.Add(pair.Value);
110 public void Add(global::System.Collections.Generic.KeyValuePair<ulong, ulong> item) {
111 Add(item.Key, item.Value);
114 public bool Remove(global::System.Collections.Generic.KeyValuePair<ulong, ulong> item) {
122 public bool Contains(global::System.Collections.Generic.KeyValuePair<ulong, ulong> item) {
123 if (
this[item.Key] == item.Value) {
130 public void CopyTo(global::System.Collections.Generic.KeyValuePair<ulong, ulong>[] array) {
134 public void CopyTo(global::System.Collections.Generic.KeyValuePair<ulong, ulong>[] array,
int arrayIndex) {
136 throw new global::System.ArgumentNullException(
"array");
138 throw new global::System.ArgumentOutOfRangeException(
"arrayIndex",
"Value is less than zero");
140 throw new global::System.ArgumentException(
"Multi dimensional array.",
"array");
141 if (arrayIndex+this.
Count > array.Length)
142 throw new global::System.ArgumentException(
"Number of elements to copy is too large.");
144 global::System.Collections.Generic.IList<ulong> keyList =
new global::System.Collections.Generic.List<ulong>(this.
Keys);
145 for (
int i = 0; i < keyList.Count; i++) {
146 ulong currentKey = keyList[i];
147 array.SetValue(
new global::System.Collections.Generic.KeyValuePair<ulong, ulong>(currentKey,
this[currentKey]), arrayIndex+i);
151 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<ulong, ulong>> global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<ulong, ulong>>.GetEnumerator() {
152 return new OdIdIdMapEnumerator(
this);
155 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
156 return new OdIdIdMapEnumerator(
this);
169 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<ulong, ulong>>
172 private global::System.Collections.Generic.IList<ulong> keyCollection;
173 private int currentIndex;
174 private object currentObject;
175 private int currentSize;
178 collectionRef = collection;
179 keyCollection =
new global::System.Collections.Generic.List<ulong>(collection.
Keys);
181 currentObject =
null;
182 currentSize = collectionRef.
Count;
186 public global::System.Collections.Generic.KeyValuePair<ulong, ulong>
Current {
188 if (currentIndex == -1)
189 throw new global::System.InvalidOperationException(
"Enumeration not started.");
190 if (currentIndex > currentSize - 1)
191 throw new global::System.InvalidOperationException(
"Enumeration finished.");
192 if (currentObject ==
null)
193 throw new global::System.InvalidOperationException(
"Collection modified.");
194 return (global::System.Collections.Generic.KeyValuePair<ulong, ulong>)currentObject;
199 object global::System.Collections.IEnumerator.Current {
206 int size = collectionRef.
Count;
207 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
210 ulong currentKey = keyCollection[currentIndex];
211 currentObject =
new global::System.Collections.Generic.KeyValuePair<ulong, ulong>(currentKey, collectionRef[currentKey]);
213 currentObject =
null;
220 currentObject =
null;
221 if (collectionRef.
Count != currentSize) {
222 throw new global::System.InvalidOperationException(
"Collection modified.");
228 currentObject =
null;
241 private uint size() {
258 private ulong getitem(ulong key) {
264 private void setitem(ulong key, ulong x) {
265 GlobalsPINVOKE.OdIdIdMap_setitem(swigCPtr, key, x);
266 if (GlobalsPINVOKE.SWIGPendingException.Pending)
throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
286 private global::System.IntPtr create_iterator_begin() {
292 private ulong get_next_key(global::System.IntPtr swigiterator) {
293 ulong ret = GlobalsPINVOKE.OdIdIdMap_get_next_key(swigCPtr, swigiterator);
294 if (GlobalsPINVOKE.SWIGPendingException.Pending)
throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
298 private void destroy_iterator(global::System.IntPtr swigiterator) {
299 GlobalsPINVOKE.OdIdIdMap_destroy_iterator(swigCPtr, swigiterator);
300 if (GlobalsPINVOKE.SWIGPendingException.Pending)
throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
static global::System.Exception Retrieve()
static global::System.IntPtr OdIdIdMap_create_iterator_begin(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool OdIdIdMap_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, ulong jarg2)
static bool OdIdIdMap_empty(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_OdIdIdMap(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool OdIdIdMap_ContainsKey(global::System.Runtime.InteropServices.HandleRef jarg1, ulong jarg2)
static uint OdIdIdMap_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static ulong OdIdIdMap_getitem(global::System.Runtime.InteropServices.HandleRef jarg1, ulong jarg2)
static void OdIdIdMap_Add(global::System.Runtime.InteropServices.HandleRef jarg1, ulong jarg2, ulong jarg3)
static void OdIdIdMap_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
OdIdIdMapEnumerator(OdIdIdMap collection)
global::System.Collections.Generic.KeyValuePair< ulong, ulong > Current
void CopyTo(global::System.Collections.Generic.KeyValuePair< ulong, ulong >[] array, int arrayIndex)
static HandleRef getCPtr(OdIdIdMap obj)
bool Contains(global::System.Collections.Generic.KeyValuePair< ulong, ulong > item)
virtual void Dispose(bool disposing)
bool Remove(global::System.Collections.Generic.KeyValuePair< ulong, ulong > item)
void Add(ulong key, ulong value)
bool ContainsKey(ulong key)
bool TryGetValue(ulong key, out ulong value)
void CopyTo(global::System.Collections.Generic.KeyValuePair< ulong, ulong >[] array)
global::System.Collections.Generic.ICollection< ulong > Values
OdIdIdMapEnumerator GetEnumerator()
OdIdIdMap(OdIdIdMap other)
global::System.Collections.Generic.ICollection< ulong > Keys
void Add(global::System.Collections.Generic.KeyValuePair< ulong, ulong > item)
OdIdIdMap(IntPtr cPtr, bool cMemoryOwn)