2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 internal class Any : global::System.IDisposable
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
24 protected bool swigCMemOwn;
26 internal Any(global::System.IntPtr cPtr, bool cMemoryOwn)
28 swigCMemOwn = cMemoryOwn;
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Any obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 //A Flag to check who called Dispose(). (By User or DisposeQueue)
38 private bool isDisposeQueued = false;
39 //A Flat to check if it is already disposed.
40 protected bool disposed = false;
46 isDisposeQueued = true;
47 DisposeQueue.Instance.Add(this);
53 //Throw excpetion if Dispose() is called in separate thread.
54 if (!Window.IsInstalled())
56 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
61 Dispose(DisposeTypes.Implicit);
65 Dispose(DisposeTypes.Explicit);
66 System.GC.SuppressFinalize(this);
70 protected virtual void Dispose(DisposeTypes type)
77 if (type == DisposeTypes.Explicit)
80 //Release your own managed resources here.
81 //You should release all of your own disposable objects here.
85 //Release your own unmanaged resources here.
86 //You should not access any managed member here except static instance.
87 //because the execution order of Finalizes is non-deterministic.
89 if (swigCPtr.Handle != global::System.IntPtr.Zero)
94 NDalicPINVOKE.delete_Any(swigCPtr);
96 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
103 public Any() : this(NDalicPINVOKE.new_Any__SWIG_0(), true)
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 public static void AssertAlways(string assertMessage)
110 NDalicPINVOKE.Any_AssertAlways(assertMessage);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 public Any(Any any) : this(NDalicPINVOKE.new_Any__SWIG_2(Any.getCPtr(any)), true)
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 public Any Assign(Any any)
121 Any ret = new Any(NDalicPINVOKE.Any_Assign(swigCPtr, Any.getCPtr(any)), false);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 public new SWIGTYPE_p_std__type_info GetType()
128 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_GetType(swigCPtr), false);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 bool ret = NDalicPINVOKE.Any_Empty(swigCPtr);
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 public class AnyContainerBase : global::System.IDisposable
142 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
143 protected bool swigCMemOwn;
145 internal AnyContainerBase(global::System.IntPtr cPtr, bool cMemoryOwn)
147 swigCMemOwn = cMemoryOwn;
148 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
151 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AnyContainerBase obj)
153 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
156 //A Flag to check who called Dispose(). (By User or DisposeQueue)
157 private bool isDisposeQueued = false;
158 //A Flat to check if it is already disposed.
159 protected bool disposed = false;
163 if (!isDisposeQueued)
165 isDisposeQueued = true;
166 DisposeQueue.Instance.Add(this);
170 public void Dispose()
172 //Throw excpetion if Dispose() is called in separate thread.
173 if (!Window.IsInstalled())
175 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
180 Dispose(DisposeTypes.Implicit);
184 Dispose(DisposeTypes.Explicit);
185 System.GC.SuppressFinalize(this);
189 protected virtual void Dispose(DisposeTypes type)
196 if (type == DisposeTypes.Explicit)
199 //Release your own managed resources here.
200 //You should release all of your own disposable objects here.
204 //Release your own unmanaged resources here.
205 //You should not access any managed member here except static instance.
206 //because the execution order of Finalizes is non-deterministic.
208 if (swigCPtr.Handle != global::System.IntPtr.Zero)
213 NDalicPINVOKE.delete_Any_AnyContainerBase(swigCPtr);
215 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
221 public AnyContainerBase(SWIGTYPE_p_std__type_info type, SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc, SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc) : this(NDalicPINVOKE.new_Any_AnyContainerBase(SWIGTYPE_p_std__type_info.getCPtr(type), SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase.getCPtr(cloneFunc), SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void.getCPtr(deleteFunc)), true)
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public new SWIGTYPE_p_std__type_info GetType()
228 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_AnyContainerBase_GetType(swigCPtr), false);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public SWIGTYPE_p_std__type_info mType
237 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_AnyContainerBase_mType_get(swigCPtr), false);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase mCloneFunc
247 NDalicPINVOKE.Any_AnyContainerBase_mCloneFunc_set(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase.getCPtr(value));
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 global::System.IntPtr cPtr = NDalicPINVOKE.Any_AnyContainerBase_mCloneFunc_get(swigCPtr);
253 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(cPtr, false);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 public SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void mDeleteFunc
263 NDalicPINVOKE.Any_AnyContainerBase_mDeleteFunc_set(swigCPtr, SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void.getCPtr(value));
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 global::System.IntPtr cPtr = NDalicPINVOKE.Any_AnyContainerBase_mDeleteFunc_get(swigCPtr);
269 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(cPtr, false);
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 public Any.AnyContainerBase mContainer
281 NDalicPINVOKE.Any_mContainer_set(swigCPtr, Any.AnyContainerBase.getCPtr(value));
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 global::System.IntPtr cPtr = NDalicPINVOKE.Any_mContainer_get(swigCPtr);
287 Any.AnyContainerBase ret = (cPtr == global::System.IntPtr.Zero) ? null : new Any.AnyContainerBase(cPtr, false);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();