/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
namespace Tizen.NUI
{
-
- internal class VectorBlob : global::System.IDisposable
+ internal class VectorBlob : Disposable
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- protected bool swigCMemOwn;
-
- internal VectorBlob(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(VectorBlob obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
- //A Flag to check who called Dispose(). (By User or DisposeQueue)
- private bool isDisposeQueued = false;
- /// <summary>
- /// A Flat to check if it is already disposed.
- /// </summary>
- protected bool disposed = false;
-
- ~VectorBlob()
+ internal VectorBlob(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
- if (!isDisposeQueued)
- {
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
- }
}
- 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);
- }
- }
- protected virtual void Dispose(DisposeTypes type)
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- 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;
- NDalicManualPINVOKE.delete_VectorBlob(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
- disposed = true;
+ Interop.VectorBlob.DeleteVectorBlob(swigCPtr);
}
public byte R
{
set
{
- NDalicManualPINVOKE.VectorBlob_r_set(swigCPtr, value);
+ Interop.VectorBlob.RSet(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- byte ret = NDalicManualPINVOKE.VectorBlob_r_get(swigCPtr);
+ byte ret = Interop.VectorBlob.RGet(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
{
set
{
- NDalicManualPINVOKE.VectorBlob_g_set(swigCPtr, value);
+ Interop.VectorBlob.GSet(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- byte ret = NDalicManualPINVOKE.VectorBlob_g_get(swigCPtr);
+ byte ret = Interop.VectorBlob.GGet(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
{
set
{
- NDalicManualPINVOKE.VectorBlob_b_set(swigCPtr, value);
+ Interop.VectorBlob.BSet(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- byte ret = NDalicManualPINVOKE.VectorBlob_b_get(swigCPtr);
+ byte ret = Interop.VectorBlob.BGet(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
{
set
{
- NDalicManualPINVOKE.VectorBlob_a_set(swigCPtr, value);
+ Interop.VectorBlob.ASet(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- byte ret = NDalicManualPINVOKE.VectorBlob_a_get(swigCPtr);
+ byte ret = Interop.VectorBlob.AGet(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
- public VectorBlob() : this(NDalicManualPINVOKE.new_VectorBlob(), true)
+ public VectorBlob() : this(Interop.VectorBlob.NewVectorBlob(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}