Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DecisionBuilderVector.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.1
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
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class DecisionBuilderVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<DecisionBuilder>
19 {
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 protected bool swigCMemOwn;
22
23 internal DecisionBuilderVector(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(DecisionBuilderVector obj) {
29 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30 }
31
32 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(DecisionBuilderVector obj) {
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
36 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.Dispose();
39 return ptr;
40 } else {
41 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
42 }
43 }
44
45 ~DecisionBuilderVector() {
46 Dispose(false);
47 }
48
49 public void Dispose() {
50 Dispose(true);
51 global::System.GC.SuppressFinalize(this);
52 }
53
54 protected virtual void Dispose(bool disposing) {
55 lock(this) {
56 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
57 if (swigCMemOwn) {
58 swigCMemOwn = false;
60 }
61 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 }
63 }
64 }
65
66 public DecisionBuilderVector(global::System.Collections.IEnumerable c) : this() {
67 if (c == null)
68 throw new global::System.ArgumentNullException("c");
69 foreach (DecisionBuilder element in c) {
70 this.Add(element);
71 }
72 }
73
74 public DecisionBuilderVector(global::System.Collections.Generic.IEnumerable<DecisionBuilder> c) : this() {
75 if (c == null)
76 throw new global::System.ArgumentNullException("c");
77 foreach (DecisionBuilder element in c) {
78 this.Add(element);
79 }
80 }
81
82 public bool IsFixedSize {
83 get {
84 return false;
85 }
86 }
87
88 public bool IsReadOnly {
89 get {
90 return false;
91 }
92 }
93
94 public DecisionBuilder this[int index] {
95 get {
96 return getitem(index);
97 }
98 set {
99 setitem(index, value);
100 }
101 }
102
103 public int Capacity {
104 get {
105 return (int)capacity();
106 }
107 set {
108 if (value < 0 || (uint)value < size())
109 throw new global::System.ArgumentOutOfRangeException("Capacity");
110 reserve((uint)value);
111 }
112 }
113
114 public bool IsEmpty {
115 get {
116 return empty();
117 }
118 }
119
120 public int Count {
121 get {
122 return (int)size();
123 }
124 }
125
126 public bool IsSynchronized {
127 get {
128 return false;
129 }
130 }
131
132 public void CopyTo(DecisionBuilder[] array)
133 {
134 CopyTo(0, array, 0, this.Count);
135 }
136
137 public void CopyTo(DecisionBuilder[] array, int arrayIndex)
138 {
139 CopyTo(0, array, arrayIndex, this.Count);
140 }
141
142 public void CopyTo(int index, DecisionBuilder[] array, int arrayIndex, int count)
143 {
144 if (array == null)
145 throw new global::System.ArgumentNullException("array");
146 if (index < 0)
147 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
148 if (arrayIndex < 0)
149 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
150 if (count < 0)
151 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
152 if (array.Rank > 1)
153 throw new global::System.ArgumentException("Multi dimensional array.", "array");
154 if (index+count > this.Count || arrayIndex+count > array.Length)
155 throw new global::System.ArgumentException("Number of elements to copy is too large.");
156 for (int i=0; i<count; i++)
157 array.SetValue(getitemcopy(index+i), arrayIndex+i);
158 }
159
160 public DecisionBuilder[] ToArray() {
161 DecisionBuilder[] array = new DecisionBuilder[this.Count];
162 this.CopyTo(array);
163 return array;
164 }
165
166 global::System.Collections.Generic.IEnumerator<DecisionBuilder> global::System.Collections.Generic.IEnumerable<DecisionBuilder>.GetEnumerator() {
167 return new DecisionBuilderVectorEnumerator(this);
168 }
169
170 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
171 return new DecisionBuilderVectorEnumerator(this);
172 }
173
174 public DecisionBuilderVectorEnumerator GetEnumerator() {
175 return new DecisionBuilderVectorEnumerator(this);
177
178 // Type-safe enumerator
183 public sealed class DecisionBuilderVectorEnumerator : global::System.Collections.IEnumerator
184 , global::System.Collections.Generic.IEnumerator<DecisionBuilder>
186 private DecisionBuilderVector collectionRef;
187 private int currentIndex;
188 private object currentObject;
189 private int currentSize;
190
192 collectionRef = collection;
193 currentIndex = -1;
194 currentObject = null;
195 currentSize = collectionRef.Count;
196 }
197
198 // Type-safe iterator Current
199 public DecisionBuilder Current {
200 get {
201 if (currentIndex == -1)
202 throw new global::System.InvalidOperationException("Enumeration not started.");
203 if (currentIndex > currentSize - 1)
204 throw new global::System.InvalidOperationException("Enumeration finished.");
205 if (currentObject == null)
206 throw new global::System.InvalidOperationException("Collection modified.");
207 return (DecisionBuilder)currentObject;
208 }
209 }
210
211 // Type-unsafe IEnumerator.Current
212 object global::System.Collections.IEnumerator.Current {
213 get {
214 return Current;
215 }
216 }
217
218 public bool MoveNext() {
219 int size = collectionRef.Count;
220 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
221 if (moveOkay) {
222 currentIndex++;
223 currentObject = collectionRef[currentIndex];
224 } else {
225 currentObject = null;
226 }
227 return moveOkay;
228 }
229
230 public void Reset() {
231 currentIndex = -1;
232 currentObject = null;
233 if (collectionRef.Count != currentSize) {
234 throw new global::System.InvalidOperationException("Collection modified.");
235 }
236 }
237
238 public void Dispose() {
239 currentIndex = -1;
240 currentObject = null;
241 }
242 }
243
244 public DecisionBuilderVector() : this(operations_research_constraint_solverPINVOKE.new_DecisionBuilderVector__SWIG_0(), true) {
245 }
247 public DecisionBuilderVector(DecisionBuilderVector other) : this(operations_research_constraint_solverPINVOKE.new_DecisionBuilderVector__SWIG_1(DecisionBuilderVector.getCPtr(other)), true) {
250
251 public void Clear() {
254
255 public void Add(DecisionBuilder x) {
258
259 private uint size() {
261 return ret;
262 }
263
264 private bool empty() {
265 bool ret = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_empty(swigCPtr);
266 return ret;
267 }
268
269 private uint capacity() {
270 uint ret = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_capacity(swigCPtr);
271 return ret;
272 }
273
274 private void reserve(uint n) {
275 operations_research_constraint_solverPINVOKE.DecisionBuilderVector_reserve(swigCPtr, n);
276 }
277
278 public DecisionBuilderVector(int capacity) : this(operations_research_constraint_solverPINVOKE.new_DecisionBuilderVector__SWIG_2(capacity), true) {
279 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
281
282 private DecisionBuilder getitemcopy(int index) {
283 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_getitemcopy(swigCPtr, index);
284 DecisionBuilder ret = (cPtr == global::System.IntPtr.Zero) ? null : new DecisionBuilder(cPtr, false);
286 return ret;
287 }
288
289 private DecisionBuilder getitem(int index) {
290 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_getitem(swigCPtr, index);
291 DecisionBuilder ret = (cPtr == global::System.IntPtr.Zero) ? null : new DecisionBuilder(cPtr, false);
292 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
293 return ret;
294 }
295
296 private void setitem(int index, DecisionBuilder val) {
297 operations_research_constraint_solverPINVOKE.DecisionBuilderVector_setitem(swigCPtr, index, DecisionBuilder.getCPtr(val));
298 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
299 }
300
301 public void AddRange(DecisionBuilderVector values) {
302 operations_research_constraint_solverPINVOKE.DecisionBuilderVector_AddRange(swigCPtr, DecisionBuilderVector.getCPtr(values));
307 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_GetRange(swigCPtr, index, count);
308 DecisionBuilderVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new DecisionBuilderVector(cPtr, true);
310 return ret;
311 }
312
313 public void Insert(int index, DecisionBuilder x) {
334 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DecisionBuilderVector_Repeat(DecisionBuilder.getCPtr(value), count);
335 DecisionBuilderVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new DecisionBuilderVector(cPtr, true);
337 return ret;
338 }
339
340 public void Reverse() {
343
344 public void Reverse(int index, int count) {
356 return ret;
357 }
358
359 public int IndexOf(DecisionBuilder value) {
361 return ret;
362 }
363
364 public int LastIndexOf(DecisionBuilder value) {
366 return ret;
367 }
368
369 public bool Remove(DecisionBuilder value) {
371 return ret;
372 }
373
374}
375
376}
DecisionBuilderVector GetRange(int index, int count)
void InsertRange(int index, DecisionBuilderVector values)
void SetRange(int index, DecisionBuilderVector values)
static DecisionBuilderVector Repeat(DecisionBuilder value, int count)
void CopyTo(DecisionBuilder[] array, int arrayIndex)
static int DecisionBuilderVector_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr DecisionBuilderVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void DecisionBuilderVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void DecisionBuilderVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void DecisionBuilderVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void DecisionBuilderVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static bool DecisionBuilderVector_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void DecisionBuilderVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void DecisionBuilderVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static uint DecisionBuilderVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void DecisionBuilderVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void DecisionBuilderVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool DecisionBuilderVector_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr DecisionBuilderVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int DecisionBuilderVector_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void DecisionBuilderVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static global::System.IntPtr DecisionBuilderVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void delete_DecisionBuilderVector(global::System.Runtime.InteropServices.HandleRef jarg1)