ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
itk::MetaDataObject< MetaDataObjectType > Class Template Reference

#include <itkMetaDataObject.h>

+ Inheritance diagram for itk::MetaDataObject< MetaDataObjectType >:
+ Collaboration diagram for itk::MetaDataObject< MetaDataObjectType >:

Detailed Description

template<typename MetaDataObjectType>
class itk::MetaDataObject< MetaDataObjectType >

Allows arbitrary data types to be stored as MetaDataObjectBase types, and to be stored in a MetaDataDictionary.

Author
Hans J. Johnson

The MetaDataObject class is a templated class that is a specialization of the MetaDataObjectBase type. This class allows arbitrary data types to be stored as MetaDataObjectBase types, and to be stored in a MetaDataDictionary.

Any class or built in type that has valid copy constructor and operator= can be wrapped directly with this simple template type.

Classes or built in types that do not have valid copy constructors or operator= implemented will have to implement those functions by deriving from MetaDataObject<MetaDataObjectType> and redefining the copy constructor and initializing constructor and the Get/Set functions to work around those deficiencies.

The behavior of the MetaDataObject<Type>::Print() function has many plausible application dependent implementations. The default implementation prints the string "[UNKNOWN PRINT CHARACTERISTICS]" that works for all possible MetaDataObject types.

The application developer may overload the default implementation to provide a specialized Print() characteristics to produce results desirable for their application. A set of very crude Macros {NATIVE_TYPE_METADATAPRINT, ITK_OBJECT_TYPE_METADATAPRINT_1COMMA, ITK_IMAGE_TYPE_METADATAPRINT } are provided to facilitate a very simple implementation, and as an example.

Examples:
Examples/IO/DicomImageReadPrintTags.cxx, Examples/IO/DicomSeriesReadPrintTags.cxx, and WikiExamples/DICOM/ResampleDICOM.cxx.

Definition at line 73 of file itkMetaDataObject.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef MetaDataObject Self
 
typedef MetaDataObjectBase Superclass
 
- Public Types inherited from itk::MetaDataObjectBase
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef MetaDataObjectBase Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const std::type_info & GetMetaDataObjectTypeInfo () const override
 
virtual const char * GetMetaDataObjectTypeName () const override
 
const MetaDataObjectType & GetMetaDataObjectValue () const
 
virtual const char * GetNameOfClass () const
 
virtual void Print (std::ostream &os) const override
 
void SetMetaDataObjectValue (const MetaDataObjectType &newValue)
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const noexcept
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 MetaDataObject ()
 
virtual ~MetaDataObject ()
 
- Protected Member Functions inherited from itk::MetaDataObjectBase
 MetaDataObjectBase ()
 
virtual ~MetaDataObjectBase ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

 MetaDataObject (const Self &)
 
void operator= (const Self &)
 

Private Attributes

MetaDataObjectType m_MetaDataObjectValue
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

template<typename MetaDataObjectType>
typedef SmartPointer< const Self > itk::MetaDataObject< MetaDataObjectType >::ConstPointer

Definition at line 81 of file itkMetaDataObject.h.

template<typename MetaDataObjectType>
typedef SmartPointer< Self > itk::MetaDataObject< MetaDataObjectType >::Pointer

Definition at line 80 of file itkMetaDataObject.h.

template<typename MetaDataObjectType>
typedef MetaDataObject itk::MetaDataObject< MetaDataObjectType >::Self

Smart pointer typedef support.

Definition at line 78 of file itkMetaDataObject.h.

template<typename MetaDataObjectType>
typedef MetaDataObjectBase itk::MetaDataObject< MetaDataObjectType >::Superclass

Definition at line 79 of file itkMetaDataObject.h.

Constructor & Destructor Documentation

template<typename MetaDataObjectType>
itk::MetaDataObject< MetaDataObjectType >::MetaDataObject ( )
protected
template<typename MetaDataObjectType>
virtual itk::MetaDataObject< MetaDataObjectType >::~MetaDataObject ( )
protectedvirtual
template<typename MetaDataObjectType>
itk::MetaDataObject< MetaDataObjectType >::MetaDataObject ( const Self )
private

Member Function Documentation

template<typename MetaDataObjectType>
virtual ::itk::LightObject::Pointer itk::MetaDataObject< MetaDataObjectType >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

template<typename MetaDataObjectType>
virtual const std::type_info& itk::MetaDataObject< MetaDataObjectType >::GetMetaDataObjectTypeInfo ( ) const
overridevirtual

The definition of this function is necessary to fulfill the interface of the MetaDataObjectBase

Author
Hans J. Johnson
Returns
A constant reference to a std::type_info object

Reimplemented from itk::MetaDataObjectBase.

template<typename MetaDataObjectType>
virtual const char* itk::MetaDataObject< MetaDataObjectType >::GetMetaDataObjectTypeName ( ) const
overridevirtual

The definition of this function is necessary to fulfill the interface of the MetaDataObjectBase

Author
Hans J. Johnson
Returns
A pointer to a const char array containing the unique type name.

Reimplemented from itk::MetaDataObjectBase.

template<typename MetaDataObjectType>
const MetaDataObjectType& itk::MetaDataObject< MetaDataObjectType >::GetMetaDataObjectValue ( ) const

Function to return the stored value of type MetaDataObjectType.

Author
Hans J. Johnson
Returns
a constant reference to a MetaDataObjectType

Referenced by itk::ExposeMetaData().

template<typename MetaDataObjectType>
virtual const char* itk::MetaDataObject< MetaDataObjectType >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::MetaDataObjectBase.

template<typename MetaDataObjectType>
static Pointer itk::MetaDataObject< MetaDataObjectType >::New ( )
static

Method for creation through the object factory.

Referenced by itk::EncapsulateMetaData().

template<typename MetaDataObjectType>
void itk::MetaDataObject< MetaDataObjectType >::operator= ( const Self )
private
template<typename MetaDataObjectType>
virtual void itk::MetaDataObject< MetaDataObjectType >::Print ( std::ostream &  os) const
overridevirtual

Defines the default behavior for printing out this element

Parameters
osAn output stream

Reimplemented from itk::MetaDataObjectBase.

template<typename MetaDataObjectType>
void itk::MetaDataObject< MetaDataObjectType >::SetMetaDataObjectValue ( const MetaDataObjectType &  newValue)

Function to set the stored value of type MetaDataObjectType.

Author
Hans J. Johnson
Parameters
newValueA constant reference to at MetaDataObjectType.

Member Data Documentation

template<typename MetaDataObjectType>
MetaDataObjectType itk::MetaDataObject< MetaDataObjectType >::m_MetaDataObjectValue
private

A variable to store this derived type.

Author
Hans J. Johnson

Definition at line 137 of file itkMetaDataObject.h.


The documentation for this class was generated from the following file: