FDO .NET API Reference Feature Data Objects

Disposable.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  Autodesk, Inc.
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016 *
00017 */
00018 
00019 #pragma once
00020 
00021 class FdoIDisposable;
00022 
00023 BEGIN_NAMESPACE_OSGEO_RUNTIME
00024 
00025 /// \ingroup (OSGeoFDORuntime)
00026 /// \brief
00027 ///  
00028 ///     This class should be used as a base class for the managed classes
00029 ///     we define in this project since we need to manage the lifetime of 
00030 ///     unmanaged C++ FDO classes. For more information on why this is 
00031 ///     necessary see "Implementing Finalize and Dispose to Clean Up 
00032 ///     Unmanaged Resources" in the .Net Framework Reference Help
00033 public __gc __abstract class Disposable : public System::IDisposable, public System::MarshalByRefObject
00034 {
00035     System::IntPtr m_imp;
00036     System::Boolean m_bAutoDelete;
00037 
00038 public:
00039     __property System::IntPtr get_UnmanagedObject();
00040     __property System::Boolean get_Disposed();
00041     __property System::Boolean get_AutoDelete();
00042     __property System::Void set_AutoDelete(System::Boolean value);
00043     __property System::Int32 get_RefCount();
00044 
00045 protected:
00046     Disposable();
00047     Disposable(System::IntPtr unmanagedPointer, System::Boolean autoDelete);
00048     virtual ~Disposable();
00049     virtual System::Void ReleaseUnmanagedObject();
00050 
00051 public:
00052     System::Void Dispose();
00053     System::Void Detach();
00054     System::Void Attach(System::IntPtr unmanagedPointer, System::Boolean autoDelete);
00055     virtual System::Boolean Equals(System::Object* obj);
00056     static System::Boolean op_Inequality(Disposable* leftObject, Disposable* rightObject);
00057     static System::Boolean op_Equality(Disposable* leftObject, Disposable* rightObject);
00058     System::Int32 GetHashCode();
00059 
00060 public private:
00061     inline FdoIDisposable* GetImpObj();
00062 };
00063 
00064 END_NAMESPACE_OSGEO_RUNTIME
00065 
00066 

Comments or suggestions? Send us feedback.