DotNet Reference

.Net Reference

SequenceVarVector.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 
12 
13 using System;
14 using System.Runtime.InteropServices;
15 using System.Collections;
16 using System.Collections.Generic;
17 
18 public partial class SequenceVarVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<SequenceVar>
19  {
20  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21  protected bool swigCMemOwn;
22 
23  internal SequenceVarVector(global::System.IntPtr cPtr, bool cMemoryOwn) {
24  swigCMemOwn = cMemoryOwn;
25  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26  }
27 
28  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SequenceVarVector obj) {
29  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.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  public SequenceVarVector(global::System.Collections.IEnumerable c) : this() {
54  if (c == null)
55  throw new global::System.ArgumentNullException("c");
56  foreach (SequenceVar element in c) {
57  this.Add(element);
58  }
59  }
60 
61  public SequenceVarVector(global::System.Collections.Generic.IEnumerable<SequenceVar> c) : this() {
62  if (c == null)
63  throw new global::System.ArgumentNullException("c");
64  foreach (SequenceVar element in c) {
65  this.Add(element);
66  }
67  }
68 
69  public bool IsFixedSize {
70  get {
71  return false;
72  }
73  }
74 
75  public bool IsReadOnly {
76  get {
77  return false;
78  }
79  }
80 
81  public SequenceVar this[int index] {
82  get {
83  return getitem(index);
84  }
85  set {
86  setitem(index, value);
87  }
88  }
89 
90  public int Capacity {
91  get {
92  return (int)capacity();
93  }
94  set {
95  if (value < size())
96  throw new global::System.ArgumentOutOfRangeException("Capacity");
97  reserve((uint)value);
98  }
99  }
100 
101  public int Count {
102  get {
103  return (int)size();
104  }
105  }
106 
107  public bool IsSynchronized {
108  get {
109  return false;
110  }
111  }
112 
113  public void CopyTo(SequenceVar[] array)
114  {
115  CopyTo(0, array, 0, this.Count);
116  }
117 
118  public void CopyTo(SequenceVar[] array, int arrayIndex)
119  {
120  CopyTo(0, array, arrayIndex, this.Count);
121  }
122 
123  public void CopyTo(int index, SequenceVar[] array, int arrayIndex, int count)
124  {
125  if (array == null)
126  throw new global::System.ArgumentNullException("array");
127  if (index < 0)
128  throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
129  if (arrayIndex < 0)
130  throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
131  if (count < 0)
132  throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
133  if (array.Rank > 1)
134  throw new global::System.ArgumentException("Multi dimensional array.", "array");
135  if (index+count > this.Count || arrayIndex+count > array.Length)
136  throw new global::System.ArgumentException("Number of elements to copy is too large.");
137  for (int i=0; i<count; i++)
138  array.SetValue(getitemcopy(index+i), arrayIndex+i);
139  }
140 
141  public SequenceVar[] ToArray() {
142  SequenceVar[] array = new SequenceVar[this.Count];
143  this.CopyTo(array);
144  return array;
145  }
146 
147  global::System.Collections.Generic.IEnumerator<SequenceVar> global::System.Collections.Generic.IEnumerable<SequenceVar>.GetEnumerator() {
148  return new SequenceVarVectorEnumerator(this);
149  }
150 
151  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
152  return new SequenceVarVectorEnumerator(this);
153  }
154 
156  return new SequenceVarVectorEnumerator(this);
157  }
158 
159  // Type-safe enumerator
164  public sealed class SequenceVarVectorEnumerator : global::System.Collections.IEnumerator
165  , global::System.Collections.Generic.IEnumerator<SequenceVar>
166  {
167  private SequenceVarVector collectionRef;
168  private int currentIndex;
169  private object currentObject;
170  private int currentSize;
171 
173  collectionRef = collection;
174  currentIndex = -1;
175  currentObject = null;
176  currentSize = collectionRef.Count;
177  }
178 
179  // Type-safe iterator Current
181  get {
182  if (currentIndex == -1)
183  throw new global::System.InvalidOperationException("Enumeration not started.");
184  if (currentIndex > currentSize - 1)
185  throw new global::System.InvalidOperationException("Enumeration finished.");
186  if (currentObject == null)
187  throw new global::System.InvalidOperationException("Collection modified.");
188  return (SequenceVar)currentObject;
189  }
190  }
191 
192  // Type-unsafe IEnumerator.Current
193  object global::System.Collections.IEnumerator.Current {
194  get {
195  return Current;
196  }
197  }
198 
199  public bool MoveNext() {
200  int size = collectionRef.Count;
201  bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
202  if (moveOkay) {
203  currentIndex++;
204  currentObject = collectionRef[currentIndex];
205  } else {
206  currentObject = null;
207  }
208  return moveOkay;
209  }
210 
211  public void Reset() {
212  currentIndex = -1;
213  currentObject = null;
214  if (collectionRef.Count != currentSize) {
215  throw new global::System.InvalidOperationException("Collection modified.");
216  }
217  }
218 
219  public void Dispose() {
220  currentIndex = -1;
221  currentObject = null;
222  }
223  }
224 
225  public void Clear() {
227  }
228 
229  public void Add(SequenceVar x) {
231  }
232 
233  private uint size() {
235  return ret;
236  }
237 
238  private uint capacity() {
239  uint ret = operations_research_constraint_solverPINVOKE.SequenceVarVector_capacity(swigCPtr);
240  return ret;
241  }
242 
243  private void reserve(uint n) {
244  operations_research_constraint_solverPINVOKE.SequenceVarVector_reserve(swigCPtr, n);
245  }
246 
247  public SequenceVarVector() : this(operations_research_constraint_solverPINVOKE.new_SequenceVarVector__SWIG_0(), true) {
248  }
249 
250  public SequenceVarVector(SequenceVarVector other) : this(operations_research_constraint_solverPINVOKE.new_SequenceVarVector__SWIG_1(SequenceVarVector.getCPtr(other)), true) {
252  }
253 
254  public SequenceVarVector(int capacity) : this(operations_research_constraint_solverPINVOKE.new_SequenceVarVector__SWIG_2(capacity), true) {
256  }
257 
258  private SequenceVar getitemcopy(int index) {
260  SequenceVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new SequenceVar(cPtr, false);
262  return ret;
263  }
264 
265  private SequenceVar getitem(int index) {
266  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SequenceVarVector_getitem(swigCPtr, index);
267  SequenceVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new SequenceVar(cPtr, false);
268  if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
269  return ret;
270  }
271 
272  private void setitem(int index, SequenceVar val) {
273  operations_research_constraint_solverPINVOKE.SequenceVarVector_setitem(swigCPtr, index, SequenceVar.getCPtr(val));
274  if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
275  }
276 
277  public void AddRange(SequenceVarVector values) {
280  }
281 
282  public SequenceVarVector GetRange(int index, int count) {
284  SequenceVarVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SequenceVarVector(cPtr, true);
286  return ret;
287  }
288 
289  public void Insert(int index, SequenceVar x) {
292  }
293 
294  public void InsertRange(int index, SequenceVarVector values) {
297  }
298 
299  public void RemoveAt(int index) {
302  }
303 
304  public void RemoveRange(int index, int count) {
307  }
308 
309  public static SequenceVarVector Repeat(SequenceVar value, int count) {
311  SequenceVarVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SequenceVarVector(cPtr, true);
313  return ret;
314  }
315 
316  public void Reverse() {
318  }
319 
320  public void Reverse(int index, int count) {
323  }
324 
325  public void SetRange(int index, SequenceVarVector values) {
328  }
329 
330  public bool Contains(SequenceVar value) {
332  return ret;
333  }
334 
335  public int IndexOf(SequenceVar value) {
337  return ret;
338  }
339 
340  public int LastIndexOf(SequenceVar value) {
342  return ret;
343  }
344 
345  public bool Remove(SequenceVar value) {
347  return ret;
348  }
349 
350 }
351 
352 }
static void SequenceVarVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
void Reverse()
void RemoveRange(int index, int count)
SequenceVarVector()
void Clear()
SequenceVarVectorEnumerator(SequenceVarVector collection)
static uint SequenceVarVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void SequenceVarVector_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
bool Remove(SequenceVar value)
static void SequenceVarVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
bool MoveNext()
bool IsSynchronized
void Reset()
void CopyTo(SequenceVar[] array)
SequenceVarVector(SequenceVarVector other)
SequenceVarVector(int capacity)
static bool Pending
SequenceVar Current
bool IsReadOnly
static void SequenceVarVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void SequenceVarVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void SequenceVarVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
Note that the IEnumerator documentation requires an InvalidOperationException to be thrown whenever t...
static bool SequenceVarVector_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
void CopyTo(SequenceVar[] array, int arrayIndex)
Definition: SequenceVar.cs:18
static int SequenceVarVector_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
int IndexOf(SequenceVar value)
using System
Definition: Program.cs:14
virtual void Dispose(bool disposing)
static int SequenceVarVector_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static SequenceVarVector Repeat(SequenceVar value, int count)
static void delete_SequenceVarVector(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr SequenceVarVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
SequenceVarVector(global::System.Collections.Generic.IEnumerable< SequenceVar > c)
void Dispose()
void InsertRange(int index, SequenceVarVector values)
static global::System.IntPtr SequenceVarVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
void SetRange(int index, SequenceVarVector values)
void Add(SequenceVar x)
bool swigCMemOwn
bool Contains(SequenceVar value)
bool IsFixedSize
static void SequenceVarVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
void Reverse(int index, int count)
static global::System.IntPtr SequenceVarVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void SequenceVarVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void SequenceVarVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
void Dispose()
void CopyTo(int index, SequenceVar[] array, int arrayIndex, int count)
void AddRange(SequenceVarVector values)
int Capacity
int Count
SequenceVarVector(global::System.Collections.IEnumerable c)
void Insert(int index, SequenceVar x)
static void SequenceVarVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
SequenceVar[] ToArray()
int LastIndexOf(SequenceVar value)
static bool SequenceVarVector_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.Exception Retrieve()
SequenceVarVectorEnumerator GetEnumerator()
void RemoveAt(int index)
SequenceVarVector GetRange(int index, int count)