ml::ListContainerTemplate< T > Class Template Reference

Template module class ListContainerTemplate for a specific list class. More...

#include <mlListContainer.h>

Inheritance diagram for ml::ListContainerTemplate< T >:

ml::ListContainerBase ml::Module ml::FieldContainer ml::Base

List of all members.

Public Member Functions

 ListContainerTemplate (int inputNum, int outputNum)
 Constructor The values inputNum and outputNum specify the number of input and output image fields, resp.
virtual ~ListContainerTemplate ()
 Destructor.
virtual T * getList ()
 Get pointer to the active list object Use this pointer for list access after testing that it is != 0.

Public Attributes

T::itemType _currentItem
 List item object used by insertItem() and modifyItem().

Protected Member Functions

List object access
virtual bool setActiveList (Base *basePtr)
 Set the active list pointer _listPtr to basePtr, provided that it is of the correct type.
virtual ListBasegetInternalList ()
 Return address of internal list object.
virtual MLssize_t getId (MLssize_t index)
 Return the item id of the item index.
Handle item property fields
virtual void updatePropertyFields ()
 Update property fields from the current list item.
List modifications
virtual void deleteItems (MLssize_t index, MLssize_t num)
 Remove num items, starting at item index.
virtual void insertItem (MLssize_t index, bool fromCurrentItem)
 Insert an item at position index.
virtual bool modifyItem (MLssize_t index, Field *field, bool fromCurrentItem)
 Modify item at position index.
virtual void copyItemToTemplate (MLssize_t index)
 Copy values from item at position index to the template fields.
virtual void copyTemplateToCurrent ()
 Copy the values of the templates fields to _currentItem.
virtual void initItem (MLssize_t index)
 Initialize the list item at position index.

Protected Attributes

T * _listPtr
 Pointer to the active list object Use this pointer for list access after testing that it is != 0.


Detailed Description

template<class T>
class ml::ListContainerTemplate< T >

Template module class ListContainerTemplate for a specific list class.

Class template for container modules for a specific list class. Contains a list object storing the internal list and implements the method to access this object.

To implement an instance of ListContainerTemplate with a given list type T (where T must be a subclass of BaseListTemplate), the following steps are necessary:

Definition at line 369 of file mlListContainer.h.


Constructor & Destructor Documentation

template<class T >
ml::ListContainerTemplate< T >::ListContainerTemplate ( int  inputNum,
int  outputNum 
) [inline]

template<class T>
virtual ml::ListContainerTemplate< T >::~ListContainerTemplate (  )  [inline, virtual]

Destructor.

Definition at line 379 of file mlListContainer.h.


Member Function Documentation

template<class T >
void ml::ListContainerTemplate< T >::copyItemToTemplate ( MLssize_t  index  )  [inline, protected, virtual]

Copy values from item at position index to the template fields.

Implements ml::ListContainerBase.

Reimplemented in ml::XMarkerListContainer.

Definition at line 686 of file mlListContainer.h.

References ml::ListContainerBase::_fldNewName, ML_TRACE_IN, and ml::StringField::setStringValue().

template<class T >
void ml::ListContainerTemplate< T >::copyTemplateToCurrent (  )  [inline, protected, virtual]

Copy the values of the templates fields to _currentItem.

Implements ml::ListContainerBase.

Reimplemented in ml::XMarkerListContainer.

Definition at line 699 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerBase::_fldNewName, ml::StringField::getStringValue(), and ML_TRACE_IN.

template<class T >
void ml::ListContainerTemplate< T >::deleteItems ( MLssize_t  index,
MLssize_t  num 
) [inline, protected, virtual]

Remove num items, starting at item index.

Implements ml::ListContainerBase.

Definition at line 585 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_listPtr, ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class T >
MLssize_t ml::ListContainerTemplate< T >::getId ( MLssize_t  index  )  [inline, protected, virtual]

Return the item id of the item index.

Implements ml::ListContainerBase.

Definition at line 550 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_listPtr, and ML_TRACE_IN.

Referenced by ml::ListContainerTemplate< T >::modifyItem().

template<class T>
virtual ListBase* ml::ListContainerTemplate< T >::getInternalList (  )  [inline, protected, virtual]

Return address of internal list object.

Implements ml::ListContainerBase.

Definition at line 406 of file mlListContainer.h.

template<class T>
virtual T* ml::ListContainerTemplate< T >::getList (  )  [inline, virtual]

Get pointer to the active list object Use this pointer for list access after testing that it is != 0.

If the pointer is 0, an external object of a wrong type is connected to the input base field, in which case the module should be completely deactivated.

Definition at line 386 of file mlListContainer.h.

Referenced by ml::ITKNodeContainerFromBasePointer(), ml::ITKPointSetFromBasePointer(), and ml::ITKPolylineFromBasePointer().

template<class T >
void ml::ListContainerTemplate< T >::initItem ( MLssize_t  index  )  [inline, protected, virtual]

Initialize the list item at position index.

This method is called by insertItem() if the fromCurrentItem argument is false. Moreover it is called when fldInit is touched.

This method is called by insertItem() if the fromCurrentItem argument is false. Moreover it is called when _fldClearItem is touched.

Implements ml::ListContainerBase.

Reimplemented in ml::XMarkerListContainer.

Definition at line 712 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_listPtr, and ML_TRACE_IN.

Referenced by ml::ListContainerTemplate< T >::insertItem().

template<class T >
void ml::ListContainerTemplate< T >::insertItem ( MLssize_t  index,
bool  fromCurrentItem 
) [inline, protected, virtual]

Insert an item at position index.

If fromCurrentItem is true, the new item is initialized from _currentItem.

If fromCurrentItem is true, the new item is initialized from _currentItem.

Implements ml::ListContainerBase.

Definition at line 609 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerTemplate< T >::initItem(), ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class T >
bool ml::ListContainerTemplate< T >::modifyItem ( MLssize_t  index,
Field field,
bool  fromCurrentItem 
) [inline, protected, virtual]

Modify item at position index.

If fromCurrentItem is true, the item is copied from _currentItem, otherwise the item property corresponding to the property field field is modified. Return true if item has been modified.

If fromCurrentItem is true, the item is copied from _currentItem, otherwise the item property corresponding to the property field field is modified. Return true if item has been modified.

Implements ml::ListContainerBase.

Reimplemented in ml::XMarkerListContainer.

Definition at line 647 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerBase::_fldId, ml::ListContainerBase::_fldName, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerTemplate< T >::getId(), ml::StringField::getStringValue(), ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::IntField::setIntValue().

template<class T >
bool ml::ListContainerTemplate< T >::setActiveList ( Base basePtr  )  [inline, protected, virtual]

Set the active list pointer _listPtr to basePtr, provided that it is of the correct type.

Set the active list pointer _listPtr to basePtr, provided that it is of the correct type.

Otherwise the _listPtr is set to zero. Returns true if object is of correct type.

Otherwise the _listPtr is set to zero. Returns true if object is of correct type.

Implements ml::ListContainerBase.

Definition at line 529 of file mlListContainer.h.

References ml::ListContainerTemplate< T >::_listPtr, ML_BASE_IS_A, ML_TRACE_IN, and T.

template<class T >
void ml::ListContainerTemplate< T >::updatePropertyFields (  )  [inline, protected, virtual]


Member Data Documentation

template<class T>
T::itemType ml::ListContainerTemplate< T >::_currentItem

List item object used by insertItem() and modifyItem().

A derived editor module should use this variable to store a new or modified item and then call doInsertItem() or doModifyItem() with fromCurrentItem = true.

Definition at line 392 of file mlListContainer.h.

Referenced by ml::ListContainerTemplate< T >::copyTemplateToCurrent(), ml::ListContainerTemplate< T >::insertItem(), and ml::ListContainerTemplate< T >::modifyItem().

template<class T>
T* ml::ListContainerTemplate< T >::_listPtr [protected]

Pointer to the active list object Use this pointer for list access after testing that it is != 0.

If the pointer is 0, an external object of a wrong type is connected to the input base field, in which case the module should be completely deactivated.

Definition at line 456 of file mlListContainer.h.

Referenced by ml::ListContainerTemplate< T >::deleteItems(), ml::ListContainerTemplate< T >::getId(), ml::ListContainerTemplate< T >::initItem(), ml::ListContainerTemplate< T >::insertItem(), ml::ListContainerTemplate< T >::ListContainerTemplate(), ml::ListContainerTemplate< T >::modifyItem(), ml::ListContainerTemplate< T >::setActiveList(), and ml::ListContainerTemplate< T >::updatePropertyFields().


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

Generated on Sat Sep 3 18:39:39 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8