DotNet Reference

DotNet Reference

sat/UtilInt64Vector.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.Sat {
12 
13 using System;
14 using System.Runtime.InteropServices;
15 using System.Collections;
16 
17 public class UtilInt64Vector : global::System.IDisposable, global::System.Collections.IEnumerable
18  , global::System.Collections.Generic.IList<long>
19  {
20  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21  protected bool swigCMemOwn;
22 
23  internal UtilInt64Vector(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(UtilInt64Vector obj) {
29  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30  }
31 
32  ~UtilInt64Vector() {
33  Dispose();
34  }
35 
36  public virtual void Dispose() {
37  lock(this) {
38  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
39  if (swigCMemOwn) {
40  swigCMemOwn = false;
42  }
43  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
44  }
45  global::System.GC.SuppressFinalize(this);
46  }
47  }
48 
49  public UtilInt64Vector(global::System.Collections.ICollection c) : this() {
50  if (c == null)
51  throw new global::System.ArgumentNullException("c");
52  foreach (long element in c) {
53  this.Add(element);
54  }
55  }
56 
57  public bool IsFixedSize {
58  get {
59  return false;
60  }
61  }
62 
63  public bool IsReadOnly {
64  get {
65  return false;
66  }
67  }
68 
69  public long this[int index] {
70  get {
71  return getitem(index);
72  }
73  set {
74  setitem(index, value);
75  }
76  }
77 
78  public int Capacity {
79  get {
80  return (int)capacity();
81  }
82  set {
83  if (value < size())
84  throw new global::System.ArgumentOutOfRangeException("Capacity");
85  reserve((uint)value);
86  }
87  }
88 
89  public int Count {
90  get {
91  return (int)size();
92  }
93  }
94 
95  public bool IsSynchronized {
96  get {
97  return false;
98  }
99  }
100 
101  public void CopyTo(long[] array)
102  {
103  CopyTo(0, array, 0, this.Count);
104  }
105 
106  public void CopyTo(long[] array, int arrayIndex)
107  {
108  CopyTo(0, array, arrayIndex, this.Count);
109  }
110 
111  public void CopyTo(int index, long[] array, int arrayIndex, int count)
112  {
113  if (array == null)
114  throw new global::System.ArgumentNullException("array");
115  if (index < 0)
116  throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
117  if (arrayIndex < 0)
118  throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
119  if (count < 0)
120  throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
121  if (array.Rank > 1)
122  throw new global::System.ArgumentException("Multi dimensional array.", "array");
123  if (index+count > this.Count || arrayIndex+count > array.Length)
124  throw new global::System.ArgumentException("Number of elements to copy is too large.");
125  for (int i=0; i<count; i++)
126  array.SetValue(getitemcopy(index+i), arrayIndex+i);
127  }
128 
129  global::System.Collections.Generic.IEnumerator<long> global::System.Collections.Generic.IEnumerable<long>.GetEnumerator() {
130  return new UtilInt64VectorEnumerator(this);
131  }
132 
133  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
134  return new UtilInt64VectorEnumerator(this);
135  }
136 
138  return new UtilInt64VectorEnumerator(this);
139  }
140 
141  // Type-safe enumerator
146  public sealed class UtilInt64VectorEnumerator : global::System.Collections.IEnumerator
147  , global::System.Collections.Generic.IEnumerator<long>
148  {
149  private UtilInt64Vector collectionRef;
150  private int currentIndex;
151  private object currentObject;
152  private int currentSize;
153 
155  collectionRef = collection;
156  currentIndex = -1;
157  currentObject = null;
158  currentSize = collectionRef.Count;
159  }
160 
161  // Type-safe iterator Current
162  public long Current {
163  get {
164  if (currentIndex == -1)
165  throw new global::System.InvalidOperationException("Enumeration not started.");
166  if (currentIndex > currentSize - 1)
167  throw new global::System.InvalidOperationException("Enumeration finished.");
168  if (currentObject == null)
169  throw new global::System.InvalidOperationException("Collection modified.");
170  return (long)currentObject;
171  }
172  }
173 
174  // Type-unsafe IEnumerator.Current
175  object global::System.Collections.IEnumerator.Current {
176  get {
177  return Current;
178  }
179  }
180 
181  public bool MoveNext() {
182  int size = collectionRef.Count;
183  bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
184  if (moveOkay) {
185  currentIndex++;
186  currentObject = collectionRef[currentIndex];
187  } else {
188  currentObject = null;
189  }
190  return moveOkay;
191  }
192 
193  public void Reset() {
194  currentIndex = -1;
195  currentObject = null;
196  if (collectionRef.Count != currentSize) {
197  throw new global::System.InvalidOperationException("Collection modified.");
198  }
199  }
200 
201  public void Dispose() {
202  currentIndex = -1;
203  currentObject = null;
204  }
205  }
206 
207  public void Clear() {
209  }
210 
211  public void Add(long x) {
213  }
214 
215  private uint size() {
217  return ret;
218  }
219 
220  private uint capacity() {
221  uint ret = operations_research_satPINVOKE.UtilInt64Vector_capacity(swigCPtr);
222  return ret;
223  }
224 
225  private void reserve(uint n) {
226  operations_research_satPINVOKE.UtilInt64Vector_reserve(swigCPtr, n);
227  }
228 
229  public UtilInt64Vector() : this(operations_research_satPINVOKE.new_UtilInt64Vector__SWIG_0(), true) {
230  }
231 
232  public UtilInt64Vector(UtilInt64Vector other) : this(operations_research_satPINVOKE.new_UtilInt64Vector__SWIG_1(UtilInt64Vector.getCPtr(other)), true) {
234  }
235 
236  public UtilInt64Vector(int capacity) : this(operations_research_satPINVOKE.new_UtilInt64Vector__SWIG_2(capacity), true) {
238  }
239 
240  private long getitemcopy(int index) {
243  return ret;
244  }
245 
246  private long getitem(int index) {
247  long ret = operations_research_satPINVOKE.UtilInt64Vector_getitem(swigCPtr, index);
248  if (operations_research_satPINVOKE.SWIGPendingException.Pending) throw operations_research_satPINVOKE.SWIGPendingException.Retrieve();
249  return ret;
250  }
251 
252  private void setitem(int index, long val) {
253  operations_research_satPINVOKE.UtilInt64Vector_setitem(swigCPtr, index, val);
254  if (operations_research_satPINVOKE.SWIGPendingException.Pending) throw operations_research_satPINVOKE.SWIGPendingException.Retrieve();
255  }
256 
257  public void AddRange(UtilInt64Vector values) {
260  }
261 
262  public UtilInt64Vector GetRange(int index, int count) {
263  global::System.IntPtr cPtr = operations_research_satPINVOKE.UtilInt64Vector_GetRange(swigCPtr, index, count);
264  UtilInt64Vector ret = (cPtr == global::System.IntPtr.Zero) ? null : new UtilInt64Vector(cPtr, true);
266  return ret;
267  }
268 
269  public void Insert(int index, long x) {
272  }
273 
274  public void InsertRange(int index, UtilInt64Vector values) {
277  }
278 
279  public void RemoveAt(int index) {
282  }
283 
284  public void RemoveRange(int index, int count) {
287  }
288 
289  public static UtilInt64Vector Repeat(long value, int count) {
290  global::System.IntPtr cPtr = operations_research_satPINVOKE.UtilInt64Vector_Repeat(value, count);
291  UtilInt64Vector ret = (cPtr == global::System.IntPtr.Zero) ? null : new UtilInt64Vector(cPtr, true);
293  return ret;
294  }
295 
296  public void Reverse() {
298  }
299 
300  public void Reverse(int index, int count) {
303  }
304 
305  public void SetRange(int index, UtilInt64Vector values) {
308  }
309 
310  public bool Contains(long value) {
311  bool ret = operations_research_satPINVOKE.UtilInt64Vector_Contains(swigCPtr, value);
312  return ret;
313  }
314 
315  public int IndexOf(long value) {
316  int ret = operations_research_satPINVOKE.UtilInt64Vector_IndexOf(swigCPtr, value);
317  return ret;
318  }
319 
320  public int LastIndexOf(long value) {
322  return ret;
323  }
324 
325  public bool Remove(long value) {
326  bool ret = operations_research_satPINVOKE.UtilInt64Vector_Remove(swigCPtr, value);
327  return ret;
328  }
329 
330 }
331 
332 }
static global::System.Exception Retrieve()
UtilInt64VectorEnumerator(UtilInt64Vector collection)
UtilInt64Vector(global::System.Collections.ICollection c)
void RemoveRange(int index, int count)
int LastIndexOf(long value)
void Reset()
static void delete_UtilInt64Vector(global::System.Runtime.InteropServices.HandleRef jarg1)
int Count
void RemoveAt(int index)
static int UtilInt64Vector_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static int UtilInt64Vector_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool UtilInt64Vector_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool Pending
bool IsFixedSize
UtilInt64VectorEnumerator GetEnumerator()
void Insert(int index, long x)
static long UtilInt64Vector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void UtilInt64Vector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
bool IsSynchronized
static uint UtilInt64Vector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
bool Remove(long value)
void Dispose()
UtilInt64Vector(int capacity)
void AddRange(UtilInt64Vector values)
void Reverse()
long Current
int Capacity
static void UtilInt64Vector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, long jarg3)
UtilInt64Vector GetRange(int index, int count)
UtilInt64Vector()
static void UtilInt64Vector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void UtilInt64Vector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
void CopyTo(int index, long[] array, int arrayIndex, int count)
Note that the IEnumerator documentation requires an InvalidOperationException to be thrown whenever t...
virtual void Dispose()
bool IsReadOnly
static global::System.IntPtr UtilInt64Vector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
UtilInt64Vector(UtilInt64Vector other)
static void UtilInt64Vector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
void InsertRange(int index, UtilInt64Vector values)
static UtilInt64Vector Repeat(long value, int count)
bool MoveNext()
static void UtilInt64Vector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void UtilInt64Vector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void UtilInt64Vector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
void Reverse(int index, int count)
bool swigCMemOwn
void Clear()
static global::System.IntPtr UtilInt64Vector_Repeat(long jarg1, int jarg2)
static void UtilInt64Vector_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
void CopyTo(long[] array)
static void UtilInt64Vector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
void Add(long x)
static bool UtilInt64Vector_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
bool Contains(long value)
void SetRange(int index, UtilInt64Vector values)
int IndexOf(long value)
void CopyTo(long[] array, int arrayIndex)
Definition: CpModel.pb.cs:12