313 lines
11 KiB
C#
313 lines
11 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated />
|
|
//
|
|
// This file was automatically generated by SWIG (http://www.swig.org).
|
|
// Version 3.0.12
|
|
//
|
|
// Do not make changes to this file unless you know what you are doing--modify
|
|
// the SWIG interface file instead.
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
public class ItemSequence : global::System.IDisposable, global::System.Collections.IEnumerable
|
|
, global::System.Collections.Generic.IEnumerable<Item>
|
|
{
|
|
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
|
protected bool swigCMemOwn;
|
|
|
|
internal ItemSequence(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
|
swigCMemOwn = cMemoryOwn;
|
|
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
|
}
|
|
|
|
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemSequence obj) {
|
|
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
|
}
|
|
|
|
~ItemSequence() {
|
|
Dispose();
|
|
}
|
|
|
|
public virtual void Dispose() {
|
|
lock(this) {
|
|
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
|
if (swigCMemOwn) {
|
|
swigCMemOwn = false;
|
|
crfsuitePINVOKE.delete_ItemSequence(swigCPtr);
|
|
}
|
|
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
|
}
|
|
global::System.GC.SuppressFinalize(this);
|
|
}
|
|
}
|
|
|
|
public ItemSequence(global::System.Collections.ICollection c) : this() {
|
|
if (c == null)
|
|
throw new global::System.ArgumentNullException("c");
|
|
foreach (Item element in c) {
|
|
this.Add(element);
|
|
}
|
|
}
|
|
|
|
public bool IsFixedSize {
|
|
get {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public bool IsReadOnly {
|
|
get {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public Item this[int index] {
|
|
get {
|
|
return getitem(index);
|
|
}
|
|
set {
|
|
setitem(index, value);
|
|
}
|
|
}
|
|
|
|
public int Capacity {
|
|
get {
|
|
return (int)capacity();
|
|
}
|
|
set {
|
|
if (value < size())
|
|
throw new global::System.ArgumentOutOfRangeException("Capacity");
|
|
reserve((uint)value);
|
|
}
|
|
}
|
|
|
|
public int Count {
|
|
get {
|
|
return (int)size();
|
|
}
|
|
}
|
|
|
|
public bool IsSynchronized {
|
|
get {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public void CopyTo(Item[] array)
|
|
{
|
|
CopyTo(0, array, 0, this.Count);
|
|
}
|
|
|
|
public void CopyTo(Item[] array, int arrayIndex)
|
|
{
|
|
CopyTo(0, array, arrayIndex, this.Count);
|
|
}
|
|
|
|
public void CopyTo(int index, Item[] array, int arrayIndex, int count)
|
|
{
|
|
if (array == null)
|
|
throw new global::System.ArgumentNullException("array");
|
|
if (index < 0)
|
|
throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
|
|
if (arrayIndex < 0)
|
|
throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
|
|
if (count < 0)
|
|
throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
|
|
if (array.Rank > 1)
|
|
throw new global::System.ArgumentException("Multi dimensional array.", "array");
|
|
if (index+count > this.Count || arrayIndex+count > array.Length)
|
|
throw new global::System.ArgumentException("Number of elements to copy is too large.");
|
|
for (int i=0; i<count; i++)
|
|
array.SetValue(getitemcopy(index+i), arrayIndex+i);
|
|
}
|
|
|
|
global::System.Collections.Generic.IEnumerator<Item> global::System.Collections.Generic.IEnumerable<Item>.GetEnumerator() {
|
|
return new ItemSequenceEnumerator(this);
|
|
}
|
|
|
|
global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
|
|
return new ItemSequenceEnumerator(this);
|
|
}
|
|
|
|
public ItemSequenceEnumerator GetEnumerator() {
|
|
return new ItemSequenceEnumerator(this);
|
|
}
|
|
|
|
// Type-safe enumerator
|
|
/// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
|
|
/// whenever the collection is modified. This has been done for changes in the size of the
|
|
/// collection but not when one of the elements of the collection is modified as it is a bit
|
|
/// tricky to detect unmanaged code that modifies the collection under our feet.
|
|
public sealed class ItemSequenceEnumerator : global::System.Collections.IEnumerator
|
|
, global::System.Collections.Generic.IEnumerator<Item>
|
|
{
|
|
private ItemSequence collectionRef;
|
|
private int currentIndex;
|
|
private object currentObject;
|
|
private int currentSize;
|
|
|
|
public ItemSequenceEnumerator(ItemSequence collection) {
|
|
collectionRef = collection;
|
|
currentIndex = -1;
|
|
currentObject = null;
|
|
currentSize = collectionRef.Count;
|
|
}
|
|
|
|
// Type-safe iterator Current
|
|
public Item Current {
|
|
get {
|
|
if (currentIndex == -1)
|
|
throw new global::System.InvalidOperationException("Enumeration not started.");
|
|
if (currentIndex > currentSize - 1)
|
|
throw new global::System.InvalidOperationException("Enumeration finished.");
|
|
if (currentObject == null)
|
|
throw new global::System.InvalidOperationException("Collection modified.");
|
|
return (Item)currentObject;
|
|
}
|
|
}
|
|
|
|
// Type-unsafe IEnumerator.Current
|
|
object global::System.Collections.IEnumerator.Current {
|
|
get {
|
|
return Current;
|
|
}
|
|
}
|
|
|
|
public bool MoveNext() {
|
|
int size = collectionRef.Count;
|
|
bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
|
|
if (moveOkay) {
|
|
currentIndex++;
|
|
currentObject = collectionRef[currentIndex];
|
|
} else {
|
|
currentObject = null;
|
|
}
|
|
return moveOkay;
|
|
}
|
|
|
|
public void Reset() {
|
|
currentIndex = -1;
|
|
currentObject = null;
|
|
if (collectionRef.Count != currentSize) {
|
|
throw new global::System.InvalidOperationException("Collection modified.");
|
|
}
|
|
}
|
|
|
|
public void Dispose() {
|
|
currentIndex = -1;
|
|
currentObject = null;
|
|
}
|
|
}
|
|
|
|
public void Clear() {
|
|
crfsuitePINVOKE.ItemSequence_Clear(swigCPtr);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void Add(Item x) {
|
|
crfsuitePINVOKE.ItemSequence_Add(swigCPtr, Item.getCPtr(x));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
private uint size() {
|
|
uint ret = crfsuitePINVOKE.ItemSequence_size(swigCPtr);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
private uint capacity() {
|
|
uint ret = crfsuitePINVOKE.ItemSequence_capacity(swigCPtr);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
private void reserve(uint n) {
|
|
crfsuitePINVOKE.ItemSequence_reserve(swigCPtr, n);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public ItemSequence() : this(crfsuitePINVOKE.new_ItemSequence__SWIG_0(), true) {
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public ItemSequence(ItemSequence other) : this(crfsuitePINVOKE.new_ItemSequence__SWIG_1(ItemSequence.getCPtr(other)), true) {
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public ItemSequence(int capacity) : this(crfsuitePINVOKE.new_ItemSequence__SWIG_2(capacity), true) {
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
private Item getitemcopy(int index) {
|
|
Item ret = new Item(crfsuitePINVOKE.ItemSequence_getitemcopy(swigCPtr, index), true);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
private Item getitem(int index) {
|
|
Item ret = new Item(crfsuitePINVOKE.ItemSequence_getitem(swigCPtr, index), false);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
private void setitem(int index, Item val) {
|
|
crfsuitePINVOKE.ItemSequence_setitem(swigCPtr, index, Item.getCPtr(val));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void AddRange(ItemSequence values) {
|
|
crfsuitePINVOKE.ItemSequence_AddRange(swigCPtr, ItemSequence.getCPtr(values));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public ItemSequence GetRange(int index, int count) {
|
|
global::System.IntPtr cPtr = crfsuitePINVOKE.ItemSequence_GetRange(swigCPtr, index, count);
|
|
ItemSequence ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemSequence(cPtr, true);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
public void Insert(int index, Item x) {
|
|
crfsuitePINVOKE.ItemSequence_Insert(swigCPtr, index, Item.getCPtr(x));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void InsertRange(int index, ItemSequence values) {
|
|
crfsuitePINVOKE.ItemSequence_InsertRange(swigCPtr, index, ItemSequence.getCPtr(values));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void RemoveAt(int index) {
|
|
crfsuitePINVOKE.ItemSequence_RemoveAt(swigCPtr, index);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void RemoveRange(int index, int count) {
|
|
crfsuitePINVOKE.ItemSequence_RemoveRange(swigCPtr, index, count);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public static ItemSequence Repeat(Item value, int count) {
|
|
global::System.IntPtr cPtr = crfsuitePINVOKE.ItemSequence_Repeat(Item.getCPtr(value), count);
|
|
ItemSequence ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemSequence(cPtr, true);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
public void Reverse() {
|
|
crfsuitePINVOKE.ItemSequence_Reverse__SWIG_0(swigCPtr);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void Reverse(int index, int count) {
|
|
crfsuitePINVOKE.ItemSequence_Reverse__SWIG_1(swigCPtr, index, count);
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
public void SetRange(int index, ItemSequence values) {
|
|
crfsuitePINVOKE.ItemSequence_SetRange(swigCPtr, index, ItemSequence.getCPtr(values));
|
|
if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve();
|
|
}
|
|
|
|
}
|