sync with devel/master branch
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / VectorUint16Pair.cs
index 65851cd..ca97fa4 100755 (executable)
 // the SWIG interface file instead.
 //------------------------------------------------------------------------------
 
-namespace Tizen.NUI {
+namespace Tizen.NUI
+{
+
+    internal class VectorUint16Pair : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal VectorUint16Pair(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
 
-    internal class VectorUint16Pair : global::System.IDisposable {
-  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-  protected bool swigCMemOwn;
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VectorUint16Pair obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
 
-  internal VectorUint16Pair(global::System.IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-  }
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
 
-  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VectorUint16Pair obj) {
-    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
-  }
 
-  ~VectorUint16Pair() {
-    DisposeQueue.Instance.Add(this);
-  }
+        ~VectorUint16Pair()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
 
-  public virtual void Dispose() {
-    if (!Window.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
 
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VectorUint16Pair(swigCPtr);
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //Release your own unmanaged resources here.
+            //You should not access any managed member here except static instance.
+            //because the execution order of Finalizes is non-deterministic.
+
+            if (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                if (swigCMemOwn)
+                {
+                    swigCMemOwn = false;
+                    NDalicPINVOKE.delete_VectorUint16Pair(swigCPtr);
+                }
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
         }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-
-
-  public VectorUint16Pair() : this(NDalicPINVOKE.new_VectorUint16Pair__SWIG_0(), true) {
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public VectorUint16Pair(VectorUint16Pair vector) : this(NDalicPINVOKE.new_VectorUint16Pair__SWIG_1(VectorUint16Pair.getCPtr(vector)), true) {
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public VectorUint16Pair Assign(VectorUint16Pair vector) {
-    VectorUint16Pair ret = new VectorUint16Pair(NDalicPINVOKE.VectorUint16Pair_Assign(swigCPtr, VectorUint16Pair.getCPtr(vector)), false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public Uint16Pair Begin() {
-    global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Begin(swigCPtr);
-    Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public Uint16Pair End() {
-    global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_End(swigCPtr);
-    Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public Uint16Pair ValueOfIndex(uint index) {
-    Uint16Pair ret = new Uint16Pair(NDalicPINVOKE.VectorUint16Pair_ValueOfIndex__SWIG_0(swigCPtr, index), false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public void PushBack(Uint16Pair element) {
-    NDalicPINVOKE.VectorUint16Pair_PushBack(swigCPtr, Uint16Pair.getCPtr(element));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Insert(Uint16Pair at, Uint16Pair element) {
-    NDalicPINVOKE.VectorUint16Pair_Insert__SWIG_0(swigCPtr, Uint16Pair.getCPtr(at), Uint16Pair.getCPtr(element));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Insert(Uint16Pair at, Uint16Pair from, Uint16Pair to) {
-    NDalicPINVOKE.VectorUint16Pair_Insert__SWIG_1(swigCPtr, Uint16Pair.getCPtr(at), Uint16Pair.getCPtr(from), Uint16Pair.getCPtr(to));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Reserve(uint count) {
-    NDalicPINVOKE.VectorUint16Pair_Reserve(swigCPtr, count);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Resize(uint count) {
-    NDalicPINVOKE.VectorUint16Pair_Resize__SWIG_0(swigCPtr, count);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Resize(uint count, Uint16Pair item) {
-    NDalicPINVOKE.VectorUint16Pair_Resize__SWIG_1(swigCPtr, count, Uint16Pair.getCPtr(item));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public Uint16Pair Erase(Uint16Pair iterator) {
-    global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Erase__SWIG_0(swigCPtr, Uint16Pair.getCPtr(iterator));
-    Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public Uint16Pair Erase(Uint16Pair first, Uint16Pair last) {
-    global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Erase__SWIG_1(swigCPtr, Uint16Pair.getCPtr(first), Uint16Pair.getCPtr(last));
-    Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public void Remove(Uint16Pair iterator) {
-    NDalicPINVOKE.VectorUint16Pair_Remove(swigCPtr, Uint16Pair.getCPtr(iterator));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Swap(VectorUint16Pair vector) {
-    NDalicPINVOKE.VectorUint16Pair_Swap(swigCPtr, VectorUint16Pair.getCPtr(vector));
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Clear() {
-    NDalicPINVOKE.VectorUint16Pair_Clear(swigCPtr);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public void Release() {
-    NDalicPINVOKE.VectorUint16Pair_Release(swigCPtr);
-    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-  }
-
-  public static readonly int BaseType = NDalicPINVOKE.VectorUint16Pair_BaseType_get();
 
-}
+
+        public VectorUint16Pair() : this(NDalicPINVOKE.new_VectorUint16Pair__SWIG_0(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public VectorUint16Pair(VectorUint16Pair vector) : this(NDalicPINVOKE.new_VectorUint16Pair__SWIG_1(VectorUint16Pair.getCPtr(vector)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public VectorUint16Pair Assign(VectorUint16Pair vector)
+        {
+            VectorUint16Pair ret = new VectorUint16Pair(NDalicPINVOKE.VectorUint16Pair_Assign(swigCPtr, VectorUint16Pair.getCPtr(vector)), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public Uint16Pair Begin()
+        {
+            global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Begin(swigCPtr);
+            Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public Uint16Pair End()
+        {
+            global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_End(swigCPtr);
+            Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public Uint16Pair ValueOfIndex(uint index)
+        {
+            Uint16Pair ret = new Uint16Pair(NDalicPINVOKE.VectorUint16Pair_ValueOfIndex__SWIG_0(swigCPtr, index), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void PushBack(Uint16Pair element)
+        {
+            NDalicPINVOKE.VectorUint16Pair_PushBack(swigCPtr, Uint16Pair.getCPtr(element));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Insert(Uint16Pair at, Uint16Pair element)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Insert__SWIG_0(swigCPtr, Uint16Pair.getCPtr(at), Uint16Pair.getCPtr(element));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Insert(Uint16Pair at, Uint16Pair from, Uint16Pair to)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Insert__SWIG_1(swigCPtr, Uint16Pair.getCPtr(at), Uint16Pair.getCPtr(from), Uint16Pair.getCPtr(to));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Reserve(uint count)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Reserve(swigCPtr, count);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Resize(uint count)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Resize__SWIG_0(swigCPtr, count);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Resize(uint count, Uint16Pair item)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Resize__SWIG_1(swigCPtr, count, Uint16Pair.getCPtr(item));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public Uint16Pair Erase(Uint16Pair iterator)
+        {
+            global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Erase__SWIG_0(swigCPtr, Uint16Pair.getCPtr(iterator));
+            Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public Uint16Pair Erase(Uint16Pair first, Uint16Pair last)
+        {
+            global::System.IntPtr cPtr = NDalicPINVOKE.VectorUint16Pair_Erase__SWIG_1(swigCPtr, Uint16Pair.getCPtr(first), Uint16Pair.getCPtr(last));
+            Uint16Pair ret = (cPtr == global::System.IntPtr.Zero) ? null : new Uint16Pair(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Remove(Uint16Pair iterator)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Remove(swigCPtr, Uint16Pair.getCPtr(iterator));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Swap(VectorUint16Pair vector)
+        {
+            NDalicPINVOKE.VectorUint16Pair_Swap(swigCPtr, VectorUint16Pair.getCPtr(vector));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Clear()
+        {
+            NDalicPINVOKE.VectorUint16Pair_Clear(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Release()
+        {
+            NDalicPINVOKE.VectorUint16Pair_Release(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public static readonly int BaseType = NDalicPINVOKE.VectorUint16Pair_BaseType_get();
+
+    }
 
 }