Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkAutoPointerDataObjectDecorator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAutoPointerDataObjectDecorator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/03/08 12:57:17 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkAutoPointerDataObjectDecorator_h
00021 #define __itkAutoPointerDataObjectDecorator_h
00022 
00023 #include <memory>
00024 #include "itkDataObject.h"
00025 
00026 namespace itk
00027 {
00028 
00029 
00051 template<class T>
00052 class ITK_EXPORT AutoPointerDataObjectDecorator : public DataObject
00053 {
00054 public:
00056   typedef AutoPointerDataObjectDecorator           Self;
00057   typedef DataObject  Superclass;
00058   typedef SmartPointer<Self>  Pointer;
00059   typedef SmartPointer<const Self>  ConstPointer;
00060 
00062   typedef T ComponentType;
00063   typedef std::auto_ptr<T> ComponentPointer;
00064   
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro(AutoPointerDataObjectDecorator, DataObject);
00070 
00072   virtual void Set(T* val);
00073   
00075   virtual T* Get() { return m_Component.get(); }
00076   virtual const T* Get() const { return m_Component.get(); }
00077   
00078 protected:
00079   AutoPointerDataObjectDecorator();
00080   ~AutoPointerDataObjectDecorator();
00081   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00082 
00083 protected:
00084 
00085 private:
00086   AutoPointerDataObjectDecorator(const Self&); //purposely not implemented
00087   void operator=(const Self&); //purposely not implemented
00088 
00089   ComponentPointer m_Component;
00090 };
00091 
00092 } // end namespace itk
00093 
00094 #ifndef ITK_MANUAL_INSTANTIATION
00095 #include "itkAutoPointerDataObjectDecorator.txx"
00096 #endif
00097 
00098 #endif
00099 

Generated at Wed May 24 22:47:13 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000