1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
20 internal class Any : global::System.IDisposable
22 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23 protected bool swigCMemOwn;
25 internal Any(global::System.IntPtr cPtr, bool cMemoryOwn)
27 swigCMemOwn = cMemoryOwn;
28 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Any obj)
33 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36 //A Flag to check who called Dispose(). (By User or DisposeQueue)
37 private bool isDisposeQueued = false;
38 //A Flat to check if it is already disposed.
39 protected bool disposed = false;
45 isDisposeQueued = true;
46 DisposeQueue.Instance.Add(this);
52 //Throw excpetion if Dispose() is called in separate thread.
53 if (!Window.IsInstalled())
55 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
60 Dispose(DisposeTypes.Implicit);
64 Dispose(DisposeTypes.Explicit);
65 System.GC.SuppressFinalize(this);
69 protected virtual void Dispose(DisposeTypes type)
76 if (type == DisposeTypes.Explicit)
79 //Release your own managed resources here.
80 //You should release all of your own disposable objects here.
84 //Release your own unmanaged resources here.
85 //You should not access any managed member here except static instance.
86 //because the execution order of Finalizes is non-deterministic.
88 if (swigCPtr.Handle != global::System.IntPtr.Zero)
93 NDalicPINVOKE.delete_Any(swigCPtr);
95 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
102 public Any() : this(NDalicPINVOKE.new_Any__SWIG_0(), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 public static void AssertAlways(string assertMessage)
109 NDalicPINVOKE.Any_AssertAlways(assertMessage);
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 public Any(Any any) : this(NDalicPINVOKE.new_Any__SWIG_2(Any.getCPtr(any)), true)
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 public Any Assign(Any any)
120 Any ret = new Any(NDalicPINVOKE.Any_Assign(swigCPtr, Any.getCPtr(any)), false);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 public SWIGTYPE_p_std__type_info GetType()
127 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_GetType(swigCPtr), false);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 bool ret = NDalicPINVOKE.Any_Empty(swigCPtr);
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 public class AnyContainerBase : global::System.IDisposable
141 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
142 protected bool swigCMemOwn;
144 internal AnyContainerBase(global::System.IntPtr cPtr, bool cMemoryOwn)
146 swigCMemOwn = cMemoryOwn;
147 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
150 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AnyContainerBase obj)
152 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
155 //A Flag to check who called Dispose(). (By User or DisposeQueue)
156 private bool isDisposeQueued = false;
157 //A Flat to check if it is already disposed.
158 protected bool disposed = false;
162 if (!isDisposeQueued)
164 isDisposeQueued = true;
165 DisposeQueue.Instance.Add(this);
169 public void Dispose()
171 //Throw excpetion if Dispose() is called in separate thread.
172 if (!Window.IsInstalled())
174 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
179 Dispose(DisposeTypes.Implicit);
183 Dispose(DisposeTypes.Explicit);
184 System.GC.SuppressFinalize(this);
188 protected virtual void Dispose(DisposeTypes type)
195 if (type == DisposeTypes.Explicit)
198 //Release your own managed resources here.
199 //You should release all of your own disposable objects here.
203 //Release your own unmanaged resources here.
204 //You should not access any managed member here except static instance.
205 //because the execution order of Finalizes is non-deterministic.
207 if (swigCPtr.Handle != global::System.IntPtr.Zero)
212 NDalicPINVOKE.delete_Any_AnyContainerBase(swigCPtr);
214 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
220 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)
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 public SWIGTYPE_p_std__type_info GetType()
227 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_AnyContainerBase_GetType(swigCPtr), false);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 public SWIGTYPE_p_std__type_info mType
236 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_AnyContainerBase_mType_get(swigCPtr), false);
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 public SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase mCloneFunc
246 NDalicPINVOKE.Any_AnyContainerBase_mCloneFunc_set(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase.getCPtr(value));
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 global::System.IntPtr cPtr = NDalicPINVOKE.Any_AnyContainerBase_mCloneFunc_get(swigCPtr);
252 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);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 public SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void mDeleteFunc
262 NDalicPINVOKE.Any_AnyContainerBase_mDeleteFunc_set(swigCPtr, SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void.getCPtr(value));
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 global::System.IntPtr cPtr = NDalicPINVOKE.Any_AnyContainerBase_mDeleteFunc_get(swigCPtr);
268 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);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 public Any.AnyContainerBase mContainer
280 NDalicPINVOKE.Any_mContainer_set(swigCPtr, Any.AnyContainerBase.getCPtr(value));
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285 global::System.IntPtr cPtr = NDalicPINVOKE.Any_mContainer_get(swigCPtr);
286 Any.AnyContainerBase ret = (cPtr == global::System.IntPtr.Zero) ? null : new Any.AnyContainerBase(cPtr, false);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();