MeVisLab Toolbox Reference
ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE > Class Template Reference

Class managing a list of FieldAddOns to simplify usage of multiple AddOns; AddOns are never owned by FieldAddOnList instances, this the life time of the AddOns must be longer than the usage of FieldAddOnList instances. More...

#include <mlFieldAddOnList.h>

Inheritance diagram for ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >:
ml::DicomModifyFieldAddOnList< DicomModifyFieldAddOnBase, DicomDOCSaveAddOnPointers * > ml::DicomModifyFieldAddOnList< DicomModifyFieldAddOnBase, DicomEnhancedSaveAddOnPointers * > ml::DicomModifyFieldAddOnList< DicomModifyFieldAddOnBase, DicomSEGSaveAddOnPointers * > ml::DicomModifyFieldAddOnList< BASE_FIELD_ADD_ON_TYPE, PIMPL_OBJ_TYPE >

Public Types

typedef std::vector< FIELD_ADD_ON_BASE_CLASS * > FieldAddOnContainer
 The internally used container to manage the FieldAddOns.
 

Public Member Functions

 FieldAddOnList (FieldContainer &fieldContainerRef)
 Constructor, setting the reference of the FieldContainer managing the fields.
 
 ~FieldAddOnList () override
 Destructor.
 
FieldAddOnContainergetFieldAddOns ()
 Returns the referenced container.
 
const FieldAddOnContainergetFieldAddOns () const
 Returns the constant referenced container.
 
virtual void registerFieldAddOn (FIELD_ADD_ON_BASE_CLASS *fieldAddOn)
 Register a FieldAddOn in *this; nullptr fieldAddOn pointers are ignored and not added.
 
virtual bool hasFieldAddOn (FIELD_ADD_ON_BASE_CLASS *fieldAddOn) const
 Returns true if the passed fieldPtr is in _fieldPointers, otherwise false.
 
Redirecting standard FieldAddOnBase calls to all registered instances.
void addFields () override
 Add fields to field container of module.
 
void handleFieldActivationChanges () override
 Handle class changes according to Module::activateAttachments.
 
FieldAddOnBase::FieldChangeState handleFieldChanges (Field *field) override
 Handle field notifications according to Module::handleNotification functionality.
 

Public Attributes

PIMPL_OBJ_TYPE _pImpl
 User defined object not used in this base class (only default constructor is called), it is useful for private implementations.
 

Detailed Description

template<typename FIELD_ADD_ON_BASE_CLASS, typename PIMPL_OBJ_TYPE = void*>
class ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >

Class managing a list of FieldAddOns to simplify usage of multiple AddOns; AddOns are never owned by FieldAddOnList instances, this the life time of the AddOns must be longer than the usage of FieldAddOnList instances.

It is implemented as template allowing to derive from differently typed FieldAddOn classes and it also allows the usage of a private implementation pointer which allows to hide collections of FieldAddOns inside the list implementations without needing to make them public. FIELD_ADD_ON_BASE_CLASS is expected to fulfil the behaviour of at least FieldAddOnBase.

Definition at line 30 of file mlFieldAddOnList.h.

Member Typedef Documentation

◆ FieldAddOnContainer

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
typedef std::vector<FIELD_ADD_ON_BASE_CLASS*> ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::FieldAddOnContainer

The internally used container to manage the FieldAddOns.

Definition at line 35 of file mlFieldAddOnList.h.

Constructor & Destructor Documentation

◆ FieldAddOnList()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::FieldAddOnList ( FieldContainer & fieldContainerRef)
inline

Constructor, setting the reference of the FieldContainer managing the fields.

Definition at line 38 of file mlFieldAddOnList.h.

◆ ~FieldAddOnList()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::~FieldAddOnList ( )
inlineoverride

Destructor.

Definition at line 45 of file mlFieldAddOnList.h.

Member Function Documentation

◆ addFields()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
void ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::addFields ( )
inlineoverride

Add fields to field container of module.

All derived versions must add their fields to getFieldContainer() and with _addFieldPointer().

Definition at line 80 of file mlFieldAddOnList.h.

References mlrange_cast().

◆ getFieldAddOns() [1/2]

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
FieldAddOnContainer & ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::getFieldAddOns ( )
inline

Returns the referenced container.

Definition at line 52 of file mlFieldAddOnList.h.

◆ getFieldAddOns() [2/2]

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
const FieldAddOnContainer & ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::getFieldAddOns ( ) const
inline

Returns the constant referenced container.

Definition at line 55 of file mlFieldAddOnList.h.

◆ handleFieldActivationChanges()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
void ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::handleFieldActivationChanges ( )
inlineoverride

Handle class changes according to Module::activateAttachments.

Definition at line 87 of file mlFieldAddOnList.h.

References mlrange_cast().

◆ handleFieldChanges()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
FieldAddOnBase::FieldChangeState ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::handleFieldChanges ( Field * field)
inlineoverride

Handle field notifications according to Module::handleNotification functionality.

The default functionality return

Parameters
fieldThe field whose was changed.
Returns
RecalculationRequired if the field is found in _fieldPointer, otherwise NoChange.

Definition at line 97 of file mlFieldAddOnList.h.

References mlrange_cast().

◆ hasFieldAddOn()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
virtual bool ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::hasFieldAddOn ( FIELD_ADD_ON_BASE_CLASS * fieldAddOn) const
inlinevirtual

Returns true if the passed fieldPtr is in _fieldPointers, otherwise false.

Definition at line 66 of file mlFieldAddOnList.h.

References mlrange_cast().

◆ registerFieldAddOn()

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
virtual void ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::registerFieldAddOn ( FIELD_ADD_ON_BASE_CLASS * fieldAddOn)
inlinevirtual

Register a FieldAddOn in *this; nullptr fieldAddOn pointers are ignored and not added.

Definition at line 58 of file mlFieldAddOnList.h.

References mlrange_cast().

Member Data Documentation

◆ _pImpl

template<typename FIELD_ADD_ON_BASE_CLASS , typename PIMPL_OBJ_TYPE = void*>
PIMPL_OBJ_TYPE ml::FieldAddOnList< FIELD_ADD_ON_BASE_CLASS, PIMPL_OBJ_TYPE >::_pImpl

User defined object not used in this base class (only default constructor is called), it is useful for private implementations.

Definition at line 113 of file mlFieldAddOnList.h.


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