1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
13 internal class ActorContainer : global::System.IDisposable, global::System.Collections.IEnumerable
14 , global::System.Collections.Generic.IEnumerable<Actor>
16 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17 protected bool swigCMemOwn;
19 internal ActorContainer(global::System.IntPtr cPtr, bool cMemoryOwn) {
20 swigCMemOwn = cMemoryOwn;
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ActorContainer obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 DisposeQueue.Instance.Add(this);
32 public virtual void Dispose() {
33 if (!Stage.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_ActorContainer(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
51 public ActorContainer(global::System.Collections.ICollection c) : this() {
53 throw new global::System.ArgumentNullException("c");
54 foreach (Actor element in c) {
59 public bool IsFixedSize {
65 public bool IsReadOnly {
71 public Actor this[int index] {
73 return getitem(index);
76 setitem(index, value);
82 return (int)capacity();
86 throw new global::System.ArgumentOutOfRangeException("Capacity");
97 public bool IsSynchronized {
103 public void CopyTo(Actor[] array)
105 CopyTo(0, array, 0, this.Count);
108 public void CopyTo(Actor[] array, int arrayIndex)
110 CopyTo(0, array, arrayIndex, this.Count);
113 public void CopyTo(int index, Actor[] array, int arrayIndex, int count)
116 throw new global::System.ArgumentNullException("array");
118 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
120 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
122 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
124 throw new global::System.ArgumentException("Multi dimensional array.", "array");
125 if (index+count > this.Count || arrayIndex+count > array.Length)
126 throw new global::System.ArgumentException("Number of elements to copy is too large.");
127 for (int i=0; i<count; i++)
128 array.SetValue(getitemcopy(index+i), arrayIndex+i);
131 global::System.Collections.Generic.IEnumerator<Actor> global::System.Collections.Generic.IEnumerable<Actor>.GetEnumerator() {
132 return new ActorContainerEnumerator(this);
135 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
136 return new ActorContainerEnumerator(this);
139 public ActorContainerEnumerator GetEnumerator() {
140 return new ActorContainerEnumerator(this);
143 // Type-safe enumerator
144 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
145 /// whenever the collection is modified. This has been done for changes in the size of the
146 /// collection but not when one of the elements of the collection is modified as it is a bit
147 /// tricky to detect unmanaged code that modifies the collection under our feet.
148 public sealed class ActorContainerEnumerator : global::System.Collections.IEnumerator
149 , global::System.Collections.Generic.IEnumerator<Actor>
151 private ActorContainer collectionRef;
152 private int currentIndex;
153 private object currentObject;
154 private int currentSize;
156 public ActorContainerEnumerator(ActorContainer collection) {
157 collectionRef = collection;
159 currentObject = null;
160 currentSize = collectionRef.Count;
163 // Type-safe iterator Current
164 public Actor Current {
166 if (currentIndex == -1)
167 throw new global::System.InvalidOperationException("Enumeration not started.");
168 if (currentIndex > currentSize - 1)
169 throw new global::System.InvalidOperationException("Enumeration finished.");
170 if (currentObject == null)
171 throw new global::System.InvalidOperationException("Collection modified.");
172 return (Actor)currentObject;
176 // Type-unsafe IEnumerator.Current
177 object global::System.Collections.IEnumerator.Current {
183 public bool MoveNext() {
184 int size = collectionRef.Count;
185 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
188 currentObject = collectionRef[currentIndex];
190 currentObject = null;
195 public void Reset() {
197 currentObject = null;
198 if (collectionRef.Count != currentSize) {
199 throw new global::System.InvalidOperationException("Collection modified.");
203 public void Dispose() {
205 currentObject = null;
209 public void Clear() {
210 NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public void Add(Actor x) {
215 NDalicPINVOKE.ActorContainer_Add(swigCPtr, Actor.getCPtr(x));
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 private uint size() {
220 uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 private uint capacity() {
226 uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 private void reserve(uint n) {
232 NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 public ActorContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true) {
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 public ActorContainer(ActorContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ActorContainer.getCPtr(other)), true) {
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 public ActorContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true) {
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 private Actor getitemcopy(int index) {
249 Actor ret = new Actor(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 private Actor getitem(int index) {
255 Actor ret = new Actor(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 private void setitem(int index, Actor val) {
261 NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, Actor.getCPtr(val));
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public void AddRange(ActorContainer values) {
266 NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ActorContainer.getCPtr(values));
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 public ActorContainer GetRange(int index, int count) {
271 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
272 ActorContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ActorContainer(cPtr, true);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 public void Insert(int index, Actor x) {
278 NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, Actor.getCPtr(x));
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public void InsertRange(int index, ActorContainer values) {
283 NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ActorContainer.getCPtr(values));
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void RemoveAt(int index) {
288 NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 public void RemoveRange(int index, int count) {
293 NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 public static ActorContainer Repeat(Actor value, int count) {
298 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(Actor.getCPtr(value), count);
299 ActorContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ActorContainer(cPtr, true);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public void Reverse() {
305 NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public void Reverse(int index, int count) {
310 NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 public void SetRange(int index, ActorContainer values) {
315 NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ActorContainer.getCPtr(values));
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();