28 #ifndef itkMetaDataObject_h
29 #define itkMetaDataObject_h
72 template<
typename MetaDataObjectType >
84 itkFactorylessNewMacro(
Self);
95 virtual const char * GetMetaDataObjectTypeName() const ITK_OVERRIDE;
103 virtual const std::type_info & GetMetaDataObjectTypeInfo() const ITK_OVERRIDE;
110 const MetaDataObjectType & GetMetaDataObjectValue() const;
117 void SetMetaDataObjectValue(const MetaDataObjectType & newValue);
123 virtual
void Print(std::ostream & os) const ITK_OVERRIDE;
127 virtual ~MetaDataObject();
130 ITK_DISALLOW_COPY_AND_ASSIGN(MetaDataObject);
136 MetaDataObjectType m_MetaDataObjectValue;
148 template< typename T >
152 temp->SetMetaDataObjectValue(invalue);
153 Dictionary[key] = temp;
157 template<
typename T >
172 template<
typename T >
175 if ( !Dictionary.
HasKey(key) )
183 if ( TempMetaDataObject == ITK_NULLPTR )
201 #define ITK_NATIVE_TYPE_METADATAPRINT(TYPE_NAME) \
204 ::itk::MetaDataObject< TYPE_NAME > \
205 ::Print(std::ostream & os) const \
207 os << this->m_MetaDataObjectValue << std::endl; \
218 #define ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(TYPE_NAME_PART1, TYPE_NAME_PART2) \
221 itk::MetaDataObject< TYPE_NAME_PART1, TYPE_NAME_PART2 > \
222 ::Print(std::ostream & os) const \
224 this->m_MetaDataObjectValue->Print(os); \
234 #define ITK_IMAGE_TYPE_METADATAPRINT(STORAGE_TYPE) \
235 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 1 >::Pointer) \
236 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 2 >::Pointer) \
237 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 3 >::Pointer) \
238 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 4 >::Pointer) \
239 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 5 >::Pointer) \
240 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 6 >::Pointer) \
241 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 7 >::Pointer) \
242 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 8 >::Pointer) \
244 #ifndef ITK_MANUAL_INSTANTIATION
245 #include "itkMetaDataObject.hxx"
248 #endif //itkMetaDataObject_h
251 #ifndef ITK_TEMPLATE_EXPLICIT_MetaDataObject
260 # if defined( ITKCommon_EXPORTS )
262 # define ITKCommon_EXPORT_EXPLICIT
265 # define ITKCommon_EXPORT_EXPLICIT ITKCommon_EXPORT
270 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
271 ITK_GCC_PRAGMA_DIAG_PUSH()
273 ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
298 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
299 ITK_GCC_PRAGMA_DIAG_POP()
301 ITK_GCC_PRAGMA_DIAG(warning
"-Wattributes")
305 # undef ITKCommon_EXPORT_EXPLICIT
Light weight base class for most itk classes.
void EncapsulateMetaData(MetaDataDictionary &Dictionary, const std::string &key, const T &invalue)
ObjectType * GetPointer() const
bool ExposeMetaData(const MetaDataDictionary &Dictionary, const std::string key, T &outval)