ITK  5.4.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::DataObjectDecorator< T > Class Template Reference

#include <itkDataObjectDecorator.h>

Detailed Description

template<typename T>
class itk::DataObjectDecorator< T >

Decorates any subclass of itkObject with a DataObject API.

DataObjectDecorator decorates an instance of a subclass of itkObject with a DataObject API. This allows any itkObject to be encapsulated into a DataObject that can be passed down the pipeline. To decorate simple types (float, int, std::vector) see SimpleDataObjectDecorator.

The decorator provides two methods Set() and Get() to access the decorated object (referred internally as the component).

Note that when an instance of DataObjectDecorator is created, the component is initialized with its default constructor (in this case a null pointer).

DataObjectDecorator can decorate any subclass of itkObject. Two other decorators are provided. SimpleDataObjectDecorator can encapsulate simple types (float, int, std::vector). AutoPointerDataObjectDecorator will decorate any pointer type (for objects other than subclasses of itkObject) and manage the memory deallocating of the component.

See also
SimpleDataObjectDecorator
AutoPointerDataObjectDecorator

Definition at line 66 of file itkDataObjectDecorator.h.

+ Inheritance diagram for itk::DataObjectDecorator< T >:
+ Collaboration diagram for itk::DataObjectDecorator< T >:

Public Types

using ComponentConstPointer = typename T::ConstPointer
 
using ComponentPointer = typename T::Pointer
 
using ComponentType = T
 
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = DataObjectDecorator
 
using Superclass = DataObject
 
- Public Types inherited from itk::DataObject
using ConstPointer = SmartPointer< const Self >
 
using DataObjectIdentifierType = std::string
 
using DataObjectPointerArraySizeType = std::vector< Pointer >::size_type
 
using Pointer = SmartPointer< Self >
 
using Self = DataObject
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

ModifiedTimeType GetMTime () const override
 
const char * GetNameOfClass () const override
 
void Graft (const DataObject *) override
 
void Graft (const Self *data)
 
void Initialize () override
 
virtual void Set (const ComponentType *val)
 
virtual const ComponentTypeGet () const
 
virtual ComponentTypeGetModifiable ()
 
template<typename TOther >
void Graft (const DataObjectDecorator< TOther > *decorator)
 
- Public Member Functions inherited from itk::DataObject
virtual void CopyInformation (const DataObject *)
 
virtual void DataHasBeenGenerated ()
 
void DisconnectPipeline ()
 
bool GetDataReleased () const
 
virtual const bool & GetReleaseDataFlag () const
 
SmartPointer< ProcessObjectGetSource () const
 
DataObjectPointerArraySizeType GetSourceOutputIndex () const
 
const DataObjectIdentifierTypeGetSourceOutputName () const
 
virtual ModifiedTimeType GetUpdateMTime () const
 
virtual void PrepareForNewData ()
 
virtual void PropagateRequestedRegion ()
 
void ReleaseData ()
 
virtual void ReleaseDataFlagOn ()
 
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion ()
 
virtual void ResetPipeline ()
 
void SetReleaseDataFlag (bool flag)
 
virtual void SetRequestedRegion (const DataObject *)
 
virtual void SetRequestedRegionToLargestPossibleRegion ()
 
bool ShouldIReleaseData () const
 
virtual void Update ()
 
virtual void UpdateOutputData ()
 
virtual void UpdateOutputInformation ()
 
void UpdateSource () const
 
virtual bool VerifyRequestedRegion ()
 
void SetPipelineMTime (ModifiedTimeType time)
 
virtual const ModifiedTimeTypeGetPipelineMTime () const
 
virtual void SetRealTimeStamp (RealTimeStamp _arg)
 
virtual const RealTimeStampGetRealTimeStamp () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
const char * GetNameOfClass () const override
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::DataObject
static bool GetGlobalReleaseDataFlag ()
 
static void GlobalReleaseDataFlagOff ()
 
static void GlobalReleaseDataFlagOn ()
 
static Pointer New ()
 
static void SetGlobalReleaseDataFlag (bool val)
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 DataObjectDecorator ()=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~DataObjectDecorator () override=default
 
- Protected Member Functions inherited from itk::DataObject
 DataObject ()
 
virtual void PropagateResetPipeline ()
 
 ~DataObject () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

ComponentPointer m_Component {}
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ComponentConstPointer

template<typename T>
using itk::DataObjectDecorator< T >::ComponentConstPointer = typename T::ConstPointer

Definition at line 80 of file itkDataObjectDecorator.h.

◆ ComponentPointer

template<typename T>
using itk::DataObjectDecorator< T >::ComponentPointer = typename T::Pointer

Definition at line 79 of file itkDataObjectDecorator.h.

◆ ComponentType

template<typename T>
using itk::DataObjectDecorator< T >::ComponentType = T

Typedef for the component type (object being decorated)

Definition at line 78 of file itkDataObjectDecorator.h.

◆ ConstPointer

template<typename T>
using itk::DataObjectDecorator< T >::ConstPointer = SmartPointer<const Self>

Definition at line 75 of file itkDataObjectDecorator.h.

◆ Pointer

template<typename T>
using itk::DataObjectDecorator< T >::Pointer = SmartPointer<Self>

Definition at line 74 of file itkDataObjectDecorator.h.

◆ Self

template<typename T>
using itk::DataObjectDecorator< T >::Self = DataObjectDecorator

Standard type alias.

Definition at line 72 of file itkDataObjectDecorator.h.

◆ Superclass

template<typename T>
using itk::DataObjectDecorator< T >::Superclass = DataObject

Definition at line 73 of file itkDataObjectDecorator.h.

Constructor & Destructor Documentation

◆ DataObjectDecorator()

template<typename T>
itk::DataObjectDecorator< T >::DataObjectDecorator ( )
protecteddefault

◆ ~DataObjectDecorator()

template<typename T>
itk::DataObjectDecorator< T >::~DataObjectDecorator ( )
overrideprotecteddefault

Member Function Documentation

◆ Get()

template<typename T>
virtual const ComponentType* itk::DataObjectDecorator< T >::Get ( ) const
virtual

Get the contained object

Referenced by itk::DataObjectDecorator< T >::Graft().

◆ GetModifiable()

template<typename T>
virtual ComponentType* itk::DataObjectDecorator< T >::GetModifiable ( )
virtual

Get the contained object

◆ GetMTime()

template<typename T>
ModifiedTimeType itk::DataObjectDecorator< T >::GetMTime ( ) const
overridevirtual

The most recent MTime of this object and the held component

Reimplemented from itk::Object.

◆ GetNameOfClass()

template<typename T>
const char* itk::DataObjectDecorator< T >::GetNameOfClass ( ) const
overridevirtual
See also
LightObject::GetNameOfClass()

Reimplemented from itk::DataObject.

◆ Graft() [1/3]

template<typename T>
void itk::DataObjectDecorator< T >::Graft ( const DataObject )
overridevirtual

Graft the content of one decorator onto another.

The DataObject is dynamically_cast to this type, if successful then the component pointer is copies to that both decorators refer to the same object.

Reimplemented from itk::DataObject.

◆ Graft() [2/3]

template<typename T>
template<typename TOther >
void itk::DataObjectDecorator< T >::Graft ( const DataObjectDecorator< TOther > *  decorator)
inline

Method to aid in dynamic Graft of polymorphic types.

To this method by default a raw pointer must be used or explicit
template parameter must be provided.

Definition at line 127 of file itkDataObjectDecorator.h.

References itk::DataObjectDecorator< T >::Get().

◆ Graft() [3/3]

template<typename T>
void itk::DataObjectDecorator< T >::Graft ( const Self )
virtual

Method for grafting the content of one data object into another one. This method is intended to be overloaded by derived classes. Each one of them should use dynamic_casting in order to verify that the grafted object is actually of the same type as the class on which the Graft() method was invoked.

Reimplemented from itk::DataObject.

◆ Initialize()

template<typename T>
void itk::DataObjectDecorator< T >::Initialize ( )
overridevirtual

Restore the data object to its initial state. This means releasing the help component.

Reimplemented from itk::DataObject.

◆ New()

template<typename T>
static Pointer itk::DataObjectDecorator< T >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<typename T>
void itk::DataObjectDecorator< T >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::DataObject.

◆ Set()

template<typename T>
virtual void itk::DataObjectDecorator< T >::Set ( const ComponentType val)
virtual

Set the contained object

Member Data Documentation

◆ m_Component

template<typename T>
ComponentPointer itk::DataObjectDecorator< T >::m_Component {}
private

Definition at line 146 of file itkDataObjectDecorator.h.


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