ITK
4.4.0
Insight Segmentation and Registration Toolkit
|
#include <itkMetaDataObject.h>
Allows arbitrary data types to be stored as MetaDataObjectBase types, and to be stored in a MetaDataDictionary.
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.
Definition at line 73 of file itkMetaDataObject.h.
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef MetaDataObject | Self |
typedef MetaDataObjectBase | Superclass |
Public Types inherited from itk::MetaDataObjectBase | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef MetaDataObjectBase | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const std::type_info & | GetMetaDataObjectTypeInfo (void) const |
virtual const char * | GetMetaDataObjectTypeName (void) const |
const MetaDataObjectType & | GetMetaDataObjectValue (void) const |
virtual const char * | GetNameOfClass () const |
MetaDataObject (void) | |
MetaDataObject (const MetaDataObjectType InitializerValue) | |
MetaDataObject (const MetaDataObject< MetaDataObjectType > &TemplateObject) | |
virtual void | Print (std::ostream &os) const |
void | SetMetaDataObjectValue (const MetaDataObjectType &NewValue) |
virtual | ~MetaDataObject (void) |
Static Public Member Functions | |
static Pointer | New (void) |
Private Attributes | |
MetaDataObjectType | m_MetaDataObjectValue |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
Protected Member Functions inherited from itk::MetaDataObjectBase | |
virtual | ~MetaDataObjectBase () |
MetaDataObjectBase () | |
Protected Attributes inherited from itk::LightObject | |
InternalReferenceCountType | m_ReferenceCount |
SimpleFastMutexLock | m_ReferenceCountLock |
typedef SmartPointer< const Self > itk::MetaDataObject< MetaDataObjectType >::ConstPointer |
Definition at line 81 of file itkMetaDataObject.h.
typedef SmartPointer< Self > itk::MetaDataObject< MetaDataObjectType >::Pointer |
Definition at line 80 of file itkMetaDataObject.h.
typedef MetaDataObject itk::MetaDataObject< MetaDataObjectType >::Self |
Smart pointer typedef support.
Definition at line 78 of file itkMetaDataObject.h.
typedef MetaDataObjectBase itk::MetaDataObject< MetaDataObjectType >::Superclass |
Definition at line 79 of file itkMetaDataObject.h.
itk::MetaDataObject< MetaDataObjectType >::MetaDataObject | ( | void | ) |
Default constructor with no initialization.
|
virtual |
Default virtual Destructor
itk::MetaDataObject< MetaDataObjectType >::MetaDataObject | ( | const MetaDataObjectType | InitializerValue | ) |
Initializer constructor that sets m_MetaDataObjectValue to InitializerValue
itk::MetaDataObject< MetaDataObjectType >::MetaDataObject | ( | const MetaDataObject< MetaDataObjectType > & | TemplateObject | ) |
Copy constructor that sets m_MetaDataObjectValue to TemplateObject.m_MetaDataObjectValue
|
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.
|
virtual |
The definition of this function is necessary to fulfill the interface of the MetaDataObjectBase
Reimplemented from itk::MetaDataObjectBase.
|
virtual |
The definition of this function is necessary to fulfill the interface of the MetaDataObjectBase
Reimplemented from itk::MetaDataObjectBase.
const MetaDataObjectType& itk::MetaDataObject< MetaDataObjectType >::GetMetaDataObjectValue | ( | void | ) | const |
Function to return the stored value of type MetaDataObjectType.
Referenced by itk::ExposeMetaData().
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::MetaDataObjectBase.
|
static |
Method for creation through the object factory.
Referenced by itk::EncapsulateMetaData().
|
virtual |
Defines the default behavior for printing out this element
os | An output stream |
Reimplemented from itk::MetaDataObjectBase.
void itk::MetaDataObject< MetaDataObjectType >::SetMetaDataObjectValue | ( | const MetaDataObjectType & | NewValue | ) |
Function to set the stored value of type MetaDataObjectType.
NewValue | A constant reference to at MetaDataObjectType. |
|
private |
A variable to store this derived type.
Definition at line 158 of file itkMetaDataObject.h.