1
/* ----------------------------------------------------------------------------
2
* This file was automatically generated by SWIG (http://www.swig.org).
5
* Do not make changes to this file unless you know what you are doing--modify
6
* the SWIG interface file instead.
7
* ----------------------------------------------------------------------------- */
12
using System.Runtime.InteropServices;
14
public class YieldTermStructureVector : IDisposable, System.Collections.IEnumerable {
15
private HandleRef swigCPtr;
16
protected bool swigCMemOwn;
18
internal YieldTermStructureVector(IntPtr cPtr, bool cMemoryOwn) {
19
swigCMemOwn = cMemoryOwn;
20
swigCPtr = new HandleRef(this, cPtr);
23
internal static HandleRef getCPtr(YieldTermStructureVector obj) {
24
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
27
~YieldTermStructureVector() {
31
public virtual void Dispose() {
33
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
35
NQuantLibcPINVOKE.delete_YieldTermStructureVector(swigCPtr);
37
swigCPtr = new HandleRef(null, IntPtr.Zero);
38
GC.SuppressFinalize(this);
42
public YieldTermStructureVector(System.Collections.ICollection c) : this() {
44
throw new ArgumentNullException("c");
45
foreach (YieldTermStructureHandle element in c) {
50
public bool IsFixedSize {
56
public bool IsReadOnly {
62
public YieldTermStructureHandle this[int index] {
64
return getitem(index);
67
setitem(index, value);
73
return (int)capacity();
77
throw new ArgumentOutOfRangeException("Capacity");
88
public bool IsSynchronized {
94
public void CopyTo(System.Array array) {
95
CopyTo(0, array, 0, this.Count);
98
public void CopyTo(System.Array array, int arrayIndex) {
99
CopyTo(0, array, arrayIndex, this.Count);
102
public void CopyTo(int index, System.Array array, int arrayIndex, int count) {
104
throw new ArgumentNullException("array");
106
throw new ArgumentOutOfRangeException("index", "Value is less than zero");
108
throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
110
throw new ArgumentOutOfRangeException("count", "Value is less than zero");
112
throw new ArgumentException("Multi dimensional array.");
113
if (index+count > this.Count || arrayIndex+count > array.Length)
114
throw new ArgumentException("Number of elements to copy is too large.");
115
for (int i=0; i<count; i++)
116
array.SetValue(getitemcopy(index+i), arrayIndex+i);
119
// Type-safe version of IEnumerable.GetEnumerator
120
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
121
return new YieldTermStructureVectorEnumerator(this);
124
public YieldTermStructureVectorEnumerator GetEnumerator() {
125
return new YieldTermStructureVectorEnumerator(this);
128
// Type-safe enumerator
129
/// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
130
/// whenever the collection is modified. This has been done for changes in the size of the
131
/// collection but not when one of the elements of the collection is modified as it is a bit
132
/// tricky to detect unmanaged code that modifies the collection under our feet.
133
public sealed class YieldTermStructureVectorEnumerator : System.Collections.IEnumerator {
134
private YieldTermStructureVector collectionRef;
135
private int currentIndex;
136
private object currentObject;
137
private int currentSize;
139
public YieldTermStructureVectorEnumerator(YieldTermStructureVector collection) {
140
collectionRef = collection;
142
currentObject = null;
143
currentSize = collectionRef.Count;
146
// Type-safe iterator Current
147
public YieldTermStructureHandle Current {
149
if (currentIndex == -1)
150
throw new InvalidOperationException("Enumeration not started.");
151
if (currentIndex > currentSize - 1)
152
throw new InvalidOperationException("Enumeration finished.");
153
if (currentObject == null)
154
throw new InvalidOperationException("Collection modified.");
155
return (YieldTermStructureHandle)currentObject;
159
// Type-unsafe IEnumerator.Current
160
object System.Collections.IEnumerator.Current {
166
public bool MoveNext() {
167
int size = collectionRef.Count;
168
bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
171
currentObject = collectionRef[currentIndex];
173
currentObject = null;
178
public void Reset() {
180
currentObject = null;
181
if (collectionRef.Count != currentSize) {
182
throw new InvalidOperationException("Collection modified.");
187
public void Clear() {
188
NQuantLibcPINVOKE.YieldTermStructureVector_Clear(swigCPtr);
189
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
192
public void Add(YieldTermStructureHandle x) {
193
NQuantLibcPINVOKE.YieldTermStructureVector_Add(swigCPtr, YieldTermStructureHandle.getCPtr(x));
194
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
197
private uint size() {
198
uint ret = NQuantLibcPINVOKE.YieldTermStructureVector_size(swigCPtr);
199
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
203
private uint capacity() {
204
uint ret = NQuantLibcPINVOKE.YieldTermStructureVector_capacity(swigCPtr);
205
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
209
private void reserve(uint n) {
210
NQuantLibcPINVOKE.YieldTermStructureVector_reserve(swigCPtr, n);
211
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
214
public YieldTermStructureVector() : this(NQuantLibcPINVOKE.new_YieldTermStructureVector__SWIG_0(), true) {
215
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
218
public YieldTermStructureVector(int capacity) : this(NQuantLibcPINVOKE.new_YieldTermStructureVector__SWIG_1(capacity), true) {
219
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
222
private YieldTermStructureHandle getitemcopy(int index) {
223
YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.YieldTermStructureVector_getitemcopy(swigCPtr, index), true);
224
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
228
private YieldTermStructureHandle getitem(int index) {
229
YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.YieldTermStructureVector_getitem(swigCPtr, index), false);
230
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
234
private void setitem(int index, YieldTermStructureHandle val) {
235
NQuantLibcPINVOKE.YieldTermStructureVector_setitem(swigCPtr, index, YieldTermStructureHandle.getCPtr(val));
236
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
239
public void AddRange(YieldTermStructureVector values) {
240
NQuantLibcPINVOKE.YieldTermStructureVector_AddRange(swigCPtr, YieldTermStructureVector.getCPtr(values));
241
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
244
public YieldTermStructureVector GetRange(int index, int count) {
245
IntPtr cPtr = NQuantLibcPINVOKE.YieldTermStructureVector_GetRange(swigCPtr, index, count);
246
YieldTermStructureVector ret = (cPtr == IntPtr.Zero) ? null : new YieldTermStructureVector(cPtr, true);
247
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
251
public void Insert(int index, YieldTermStructureHandle x) {
252
NQuantLibcPINVOKE.YieldTermStructureVector_Insert(swigCPtr, index, YieldTermStructureHandle.getCPtr(x));
253
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
256
public void InsertRange(int index, YieldTermStructureVector values) {
257
NQuantLibcPINVOKE.YieldTermStructureVector_InsertRange(swigCPtr, index, YieldTermStructureVector.getCPtr(values));
258
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
261
public void RemoveAt(int index) {
262
NQuantLibcPINVOKE.YieldTermStructureVector_RemoveAt(swigCPtr, index);
263
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
266
public void RemoveRange(int index, int count) {
267
NQuantLibcPINVOKE.YieldTermStructureVector_RemoveRange(swigCPtr, index, count);
268
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
271
public static YieldTermStructureVector Repeat(YieldTermStructureHandle value, int count) {
272
IntPtr cPtr = NQuantLibcPINVOKE.YieldTermStructureVector_Repeat(YieldTermStructureHandle.getCPtr(value), count);
273
YieldTermStructureVector ret = (cPtr == IntPtr.Zero) ? null : new YieldTermStructureVector(cPtr, true);
274
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
278
public void Reverse() {
279
NQuantLibcPINVOKE.YieldTermStructureVector_Reverse__SWIG_0(swigCPtr);
280
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
283
public void Reverse(int index, int count) {
284
NQuantLibcPINVOKE.YieldTermStructureVector_Reverse__SWIG_1(swigCPtr, index, count);
285
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
288
public void SetRange(int index, YieldTermStructureVector values) {
289
NQuantLibcPINVOKE.YieldTermStructureVector_SetRange(swigCPtr, index, YieldTermStructureVector.getCPtr(values));
290
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
293
public bool Contains(YieldTermStructureHandle value) {
294
bool ret = NQuantLibcPINVOKE.YieldTermStructureVector_Contains(swigCPtr, YieldTermStructureHandle.getCPtr(value));
295
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
299
public int IndexOf(YieldTermStructureHandle value) {
300
int ret = NQuantLibcPINVOKE.YieldTermStructureVector_IndexOf(swigCPtr, YieldTermStructureHandle.getCPtr(value));
301
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
305
public int LastIndexOf(YieldTermStructureHandle value) {
306
int ret = NQuantLibcPINVOKE.YieldTermStructureVector_LastIndexOf(swigCPtr, YieldTermStructureHandle.getCPtr(value));
307
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
311
public void Remove(YieldTermStructureHandle value) {
312
NQuantLibcPINVOKE.YieldTermStructureVector_Remove(swigCPtr, YieldTermStructureHandle.getCPtr(value));
313
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();