Ejemplo n.º 1
0
        public StdSharedPtr(T obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            obj.ThrowIfDisposed();

            this._Imp           = CreateImp();
            this.NativePtr      = this._Imp.Create(obj.NativePtr);
            this._Obj           = obj;
            obj.IsEnableDispose = false;
        }
Ejemplo n.º 2
0
        //public StdSharedPtr()
        //{
        //    this._Imp = CreateImp();
        //    this.NativePtr = this._Imp.Create();
        //}

        public StdSharedPtr(T obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            obj.ThrowIfDisposed();

            this._Imp      = CreateImp();
            this.NativePtr = this._Imp.Create(obj.NativePtr);
            this._Obj      = obj;

            // set object will be destructed by native domain
            obj.IsEnableDispose = false;
        }
Ejemplo n.º 3
0
 internal StdSharedPtr(IntPtr sharedPtr)
 {
     this._Imp      = CreateImp();
     this.NativePtr = sharedPtr;
 }
Ejemplo n.º 4
0
 internal StdSharedPtr(IntPtr sharedPtr, bool isEnabledDispose = true) :
     base(isEnabledDispose)
 {
     this._Imp      = CreateImp();
     this.NativePtr = sharedPtr;
 }