00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkDataObjectDecorator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/04/25 22:25:16 $ 00007 Version: $Revision: 1.2 $ 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 __itkDataObjectDecorator_h 00021 #define __itkDataObjectDecorator_h 00022 00023 #include "itkDataObject.h" 00024 00025 namespace itk 00026 { 00027 00028 00057 template<class T> 00058 class ITK_EXPORT DataObjectDecorator : public DataObject 00059 { 00060 public: 00062 typedef DataObjectDecorator Self; 00063 typedef DataObject Superclass; 00064 typedef SmartPointer<Self> Pointer; 00065 typedef SmartPointer<const Self> ConstPointer; 00066 00068 typedef T ComponentType; 00069 typedef typename T::ConstPointer ComponentConstPointer; 00070 00072 itkNewMacro(Self); 00073 00075 itkTypeMacro(DataObjectDecorator, DataObject); 00076 00078 virtual void Set(const T * val); 00079 00081 virtual const T* Get() const; 00082 00083 protected: 00084 DataObjectDecorator(); 00085 ~DataObjectDecorator(); 00086 virtual void PrintSelf(std::ostream& os, Indent indent) const; 00087 00088 protected: 00089 00090 private: 00091 DataObjectDecorator(const Self&); //purposely not implemented 00092 void operator=(const Self&); //purposely not implemented 00093 00094 ComponentConstPointer m_Component; 00095 }; 00096 00097 } // end namespace itk 00098 00099 #ifndef ITK_MANUAL_INSTANTIATION 00100 #include "itkDataObjectDecorator.txx" 00101 #endif 00102 00103 #endif 00104 00105