KInt64VectorVector.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 3.0.12
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 
11 namespace Google.OrTools.Algorithms {
12 
13 public class KInt64VectorVector : global::System.IDisposable, global::System.Collections.IEnumerable
14  , global::System.Collections.Generic.IEnumerable<KInt64Vector>
15  {
16  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17  protected bool swigCMemOwn;
18 
19  internal KInt64VectorVector(global::System.IntPtr cPtr, bool cMemoryOwn) {
20  swigCMemOwn = cMemoryOwn;
21  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22  }
23 
24  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KInt64VectorVector obj) {
25  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26  }
27 
29  Dispose();
30  }
31 
32  public virtual void Dispose() {
33  lock(this) {
34  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35  if (swigCMemOwn) {
36  swigCMemOwn = false;
38  }
39  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40  }
41  global::System.GC.SuppressFinalize(this);
42  }
43  }
44 
45  public KInt64VectorVector(global::System.Collections.ICollection c) : this() {
46  if (c == null)
47  throw new global::System.ArgumentNullException("c");
48  foreach (KInt64Vector element in c) {
49  this.Add(element);
50  }
51  }
52 
53  public bool IsFixedSize {
54  get {
55  return false;
56  }
57  }
58 
59  public bool IsReadOnly {
60  get {
61  return false;
62  }
63  }
64 
65  public KInt64Vector this[int index] {
66  get {
67  return getitem(index);
68  }
69  set {
70  setitem(index, value);
71  }
72  }
73 
74  public int Capacity {
75  get {
76  return (int)capacity();
77  }
78  set {
79  if (value < size())
80  throw new global::System.ArgumentOutOfRangeException("Capacity");
81  reserve((uint)value);
82  }
83  }
84 
85  public int Count {
86  get {
87  return (int)size();
88  }
89  }
90 
91  public bool IsSynchronized {
92  get {
93  return false;
94  }
95  }
96 
97  public void CopyTo(KInt64Vector[] array)
98  {
99  CopyTo(0, array, 0, this.Count);
100  }
101 
102  public void CopyTo(KInt64Vector[] array, int arrayIndex)
103  {
104  CopyTo(0, array, arrayIndex, this.Count);
105  }
106 
107  public void CopyTo(int index, KInt64Vector[] array, int arrayIndex, int count)
108  {
109  if (array == null)
110  throw new global::System.ArgumentNullException("array");
111  if (index < 0)
112  throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
113  if (arrayIndex < 0)
114  throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
115  if (count < 0)
116  throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
117  if (array.Rank > 1)
118  throw new global::System.ArgumentException("Multi dimensional array.", "array");
119  if (index+count > this.Count || arrayIndex+count > array.Length)
120  throw new global::System.ArgumentException("Number of elements to copy is too large.");
121  for (int i=0; i<count; i++)
122  array.SetValue(getitemcopy(index+i), arrayIndex+i);
123  }
124 
125  global::System.Collections.Generic.IEnumerator<KInt64Vector> global::System.Collections.Generic.IEnumerable<KInt64Vector>.GetEnumerator() {
126  return new KInt64VectorVectorEnumerator(this);
127  }
128 
129  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
130  return new KInt64VectorVectorEnumerator(this);
131  }
132 
134  return new KInt64VectorVectorEnumerator(this);
135  }
136 
137  // Type-safe enumerator
142  public sealed class KInt64VectorVectorEnumerator : global::System.Collections.IEnumerator
143  , global::System.Collections.Generic.IEnumerator<KInt64Vector>
144  {
145  private KInt64VectorVector collectionRef;
146  private int currentIndex;
147  private object currentObject;
148  private int currentSize;
149 
151  collectionRef = collection;
152  currentIndex = -1;
153  currentObject = null;
154  currentSize = collectionRef.Count;
155  }
156 
157  // Type-safe iterator Current
159  get {
160  if (currentIndex == -1)
161  throw new global::System.InvalidOperationException("Enumeration not started.");
162  if (currentIndex > currentSize - 1)
163  throw new global::System.InvalidOperationException("Enumeration finished.");
164  if (currentObject == null)
165  throw new global::System.InvalidOperationException("Collection modified.");
166  return (KInt64Vector)currentObject;
167  }
168  }
169 
170  // Type-unsafe IEnumerator.Current
171  object global::System.Collections.IEnumerator.Current {
172  get {
173  return Current;
174  }
175  }
176 
177  public bool MoveNext() {
178  int size = collectionRef.Count;
179  bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
180  if (moveOkay) {
181  currentIndex++;
182  currentObject = collectionRef[currentIndex];
183  } else {
184  currentObject = null;
185  }
186  return moveOkay;
187  }
188 
189  public void Reset() {
190  currentIndex = -1;
191  currentObject = null;
192  if (collectionRef.Count != currentSize) {
193  throw new global::System.InvalidOperationException("Collection modified.");
194  }
195  }
196 
197  public void Dispose() {
198  currentIndex = -1;
199  currentObject = null;
200  }
201  }
202 
203  public void Clear() {
205  }
206 
207  public void Add(KInt64Vector x) {
210  }
211 
212  private uint size() {
214  return ret;
215  }
216 
217  private uint capacity() {
218  uint ret = operations_research_algorithmsPINVOKE.KInt64VectorVector_capacity(swigCPtr);
219  return ret;
220  }
221 
222  private void reserve(uint n) {
223  operations_research_algorithmsPINVOKE.KInt64VectorVector_reserve(swigCPtr, n);
224  }
225 
226  public KInt64VectorVector() : this(operations_research_algorithmsPINVOKE.new_KInt64VectorVector__SWIG_0(), true) {
227  }
228 
229  public KInt64VectorVector(KInt64VectorVector other) : this(operations_research_algorithmsPINVOKE.new_KInt64VectorVector__SWIG_1(KInt64VectorVector.getCPtr(other)), true) {
231  }
232 
233  public KInt64VectorVector(int capacity) : this(operations_research_algorithmsPINVOKE.new_KInt64VectorVector__SWIG_2(capacity), true) {
235  }
236 
237  private KInt64Vector getitemcopy(int index) {
240  return ret;
241  }
242 
243  private KInt64Vector getitem(int index) {
244  KInt64Vector ret = new KInt64Vector(operations_research_algorithmsPINVOKE.KInt64VectorVector_getitem(swigCPtr, index), false);
245  if (operations_research_algorithmsPINVOKE.SWIGPendingException.Pending) throw operations_research_algorithmsPINVOKE.SWIGPendingException.Retrieve();
246  return ret;
247  }
248 
249  private void setitem(int index, KInt64Vector val) {
250  operations_research_algorithmsPINVOKE.KInt64VectorVector_setitem(swigCPtr, index, KInt64Vector.getCPtr(val));
251  if (operations_research_algorithmsPINVOKE.SWIGPendingException.Pending) throw operations_research_algorithmsPINVOKE.SWIGPendingException.Retrieve();
252  }
253 
254  public void AddRange(KInt64VectorVector values) {
257  }
258 
259  public KInt64VectorVector GetRange(int index, int count) {
260  global::System.IntPtr cPtr = operations_research_algorithmsPINVOKE.KInt64VectorVector_GetRange(swigCPtr, index, count);
261  KInt64VectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new KInt64VectorVector(cPtr, true);
263  return ret;
264  }
265 
266  public void Insert(int index, KInt64Vector x) {
269  }
270 
271  public void InsertRange(int index, KInt64VectorVector values) {
274  }
275 
276  public void RemoveAt(int index) {
279  }
280 
281  public void RemoveRange(int index, int count) {
284  }
285 
286  public static KInt64VectorVector Repeat(KInt64Vector value, int count) {
287  global::System.IntPtr cPtr = operations_research_algorithmsPINVOKE.KInt64VectorVector_Repeat(KInt64Vector.getCPtr(value), count);
288  KInt64VectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new KInt64VectorVector(cPtr, true);
290  return ret;
291  }
292 
293  public void Reverse() {
295  }
296 
297  public void Reverse(int index, int count) {
300  }
301 
302  public void SetRange(int index, KInt64VectorVector values) {
305  }
306 
307 }
308 
309 }
KInt64VectorVector(global::System.Collections.ICollection c)
void InsertRange(int index, KInt64VectorVector values)
static uint KInt64VectorVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr KInt64VectorVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr KInt64VectorVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void KInt64VectorVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
void SetRange(int index, KInt64VectorVector values)
static void KInt64VectorVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void KInt64VectorVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void KInt64VectorVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void KInt64VectorVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void KInt64VectorVector_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void delete_KInt64VectorVector(global::System.Runtime.InteropServices.HandleRef jarg1)
static void KInt64VectorVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
Note that the IEnumerator documentation requires an InvalidOperationException to be thrown whenever t...
static void KInt64VectorVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
void CopyTo(KInt64Vector[] array, int arrayIndex)
KInt64VectorVector GetRange(int index, int count)
static void KInt64VectorVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
KInt64VectorVectorEnumerator GetEnumerator()
static global::System.IntPtr KInt64VectorVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
void CopyTo(int index, KInt64Vector[] array, int arrayIndex, int count)
static void KInt64VectorVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static KInt64VectorVector Repeat(KInt64Vector value, int count)
void AddRange(KInt64VectorVector values)