﻿////////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) 2007-2020 zSpace, Inc.  All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////

using System;

namespace zSpace.Core.Sdk
{
    public class ZNativeResource : IDisposable
    {
        public ZNativeResource()
        {
        }

        public ZNativeResource(IntPtr nativePtr)
        {
            this._nativePtr = nativePtr;
        }

        ////////////////////////////////////////////////////////////////////////
        // Public Properties
        ////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// The native pointer of the resource.
        /// </summary>
        public IntPtr NativePtr
        {
            get
            {
                return this._nativePtr;
            }
        }

        ////////////////////////////////////////////////////////////////////////
        // Public Methods
        ////////////////////////////////////////////////////////////////////////

        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

        ////////////////////////////////////////////////////////////////////////
        // Protected Methods
        ////////////////////////////////////////////////////////////////////////

        protected virtual void Dispose(bool disposing)
        {
        }

        ////////////////////////////////////////////////////////////////////////
        // Protected Members
        ////////////////////////////////////////////////////////////////////////

        protected IntPtr _nativePtr = IntPtr.Zero;
    }
}
