/*============================================================================= NOTE: THIS FILE IS A HANDMADE WRAPPER FOR THE ManagedITK PROJECT. Project: ManagedITK Program: Insight Segmentation & Registration Toolkit Module: itkManagedNoSmartPointerObject.cxx Language: C++/CLI Author: Dan Mueller Date: $Date: 2007-09-01 06:17:25 +1000 (Sat, 01 Sep 2007) $ Revision: $Revision: 2 $ Copyright (c) Queensland University of Technology (QUT) 2007. All rights reserved. Portions of this code are covered under the ITK and VTK copyright. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =============================================================================*/ #pragma once #pragma warning( disable : 4635 ) // Disable warnings about XML doc comments #ifndef __itkManagedNoSmartPointerObject_cxx #define __itkManagedNoSmartPointerObject_cxx // Include some headers for string ops #include #include #include using std::string; // Include some useful ManagedITK files #include "itkManagedINativePointer.cxx" // Use some managed namespaces #using #using using namespace System; using namespace System::IO; using namespace System::Reflection; using namespace System::Diagnostics; using namespace System::Collections::Generic; namespace itk { /// ///This class is a managed replacement for ITK objects which are not SmartPointers. /// public ref class itkNoSmartPointerObject abstract : INativePointer { protected: bool m_IsDisposed; bool m_DisposeNativeObjectOnFinalize; String^ m_MangledTypeString; ///Protected constructor. itkNoSmartPointerObject( ) { this->m_IsDisposed = false; this->m_DisposeNativeObjectOnFinalize = true; this->m_MangledTypeString = String::Empty; } public: ///Gets if the object has been disposed. property bool IsDisposed { virtual bool get() { return this->m_IsDisposed; } } /// ///Gets/sets if the underlying native object should be disposed when the managed object is finalized. ///The default is true. /// property bool DisposeNativeObjectOnFinalize { virtual bool get() { return this->m_DisposeNativeObjectOnFinalize; } virtual void set( bool value ) { this->m_DisposeNativeObjectOnFinalize = value; } } ///Get a string representing the type instance of this INativePointer. ///"2", "3", "UC". property String^ MangledTypeString { virtual String^ get() { return this->m_MangledTypeString; } } /// ///Get/set the pointer to the native ITK object associated with this wrapper instance. /// ///The pointer to the native ITK object. property void* NativePointer{ virtual void* get()=0; virtual void set ( void* value )=0; } }; // end ref class } // end namespace itk #endif