MeVisLabToolboxReference
ml::MergeLists Class Reference

Engine module MergeLists merging two BaseListTemplate-derived objects. More...

#include <mlMergeLists.h>

Inheritance diagram for ml::MergeLists:
ml::Engine ml::Module ml::FieldContainer ml::Base

List of all members.

Public Types

enum  AutoUpdateMode { AutoUpdateModeDoNothing = 0, AutoUpdateModeAutoClear, AutoUpdateModeAutoUpdate, AutoUpdateModeCount }
 auto update mode enum More...

Public Member Functions

 MergeLists ()
 Constructor.
 ~MergeLists ()
 Destructor.
Host communication
virtual void handleNotification (Field *field)
 Handle field notifications.
virtual void activateAttachments ()
 Update fields after an initialization without handleNotification() called.

Protected Member Functions

void _updateActionLists (int touchedList)
 Invoked by handleNotification(), assumes valid input lists! Determines whether a completely new output list is needed on the basis of (order indicates priority): 1.
void _clearActionLists ()
 clear all action lists
bool _registerIdMapping (MLssize_t whichInList, MLssize_t inListId, MLssize_t outListId)
 registers the mapping of the item with id inListId of list whichInList to the item in the output list with id outListId.
void _rebuildOutputListFromScratch ()
 rebuilds from scratch, assumes valid input lists!
void _modifyOutputList ()
 relays stored events to the output list, assumes valid input lists!
void _deleteOutputList ()
 deletes the current output list

Protected Attributes

std::vector
< ListBase::ActionClass
_listActionClassList [2]
 remember action classes for each input list since last complete rebuild
std::vector< MLssize_t_listActionIdList [2]
 remember action IDs for each input list since last complete rebuild
std::vector< MLssize_t_listActionIndexList [2]
 remember action indices for each input list since last complete rebuild
std::vector< MLssize_t_inputItemIdList [2]
 Remember ids of each input list and their corresponding output ids.
bool _needsCompleteRebuild
 flag indicating whether a new output list is needed
Field members
BaseField_fldOutputList
 Output list field, initialized by derived class.
BaseField_fldInputList [2]
 Input list fields, initialized by derived class.
NotifyField_fldUpdate
 Rebuild output list.
EnumField_fldAutoUpdateMode
 Determines auto-update mode.
NotifyField_fldClear
 Deletes the output object.
BoolField_fldAlwaysRebuild
 Always rebuild output list from scratch (instead of modifying it)
BoolField_fldNotifyForEachEvent
 Notify output list on each input list event (only for AutoApply and AlwaysRebuild OFF)

Static Protected Attributes

static const char * AutoUpdateModeNames []
 auto update mode tokens

Detailed Description

Engine module MergeLists merging two BaseListTemplate-derived objects.

Operator for merging two lists of the same arbitrary but BaseListTemplate-derived class. Currently only merge mode available is to append list1 at the end of list0. However, the output list is a new list object, and the input lists remain untouched.

Definition at line 43 of file mlMergeLists.h.


Member Enumeration Documentation

auto update mode enum

Enumerator:
AutoUpdateModeDoNothing 
AutoUpdateModeAutoClear 
AutoUpdateModeAutoUpdate 
AutoUpdateModeCount 

Definition at line 48 of file mlMergeLists.h.


Constructor & Destructor Documentation

ml::MergeLists::MergeLists ( )

Constructor.

ml::MergeLists::~MergeLists ( )

Destructor.


Member Function Documentation

void ml::MergeLists::_clearActionLists ( ) [protected]

clear all action lists

void ml::MergeLists::_deleteOutputList ( ) [protected]

deletes the current output list

void ml::MergeLists::_modifyOutputList ( ) [protected]

relays stored events to the output list, assumes valid input lists!

void ml::MergeLists::_rebuildOutputListFromScratch ( ) [protected]

rebuilds from scratch, assumes valid input lists!

bool ml::MergeLists::_registerIdMapping ( MLssize_t  whichInList,
MLssize_t  inListId,
MLssize_t  outListId 
) [protected]

registers the mapping of the item with id inListId of list whichInList to the item in the output list with id outListId.

void ml::MergeLists::_updateActionLists ( int  touchedList) [protected]

Invoked by handleNotification(), assumes valid input lists! Determines whether a completely new output list is needed on the basis of (order indicates priority): 1.

_needsCompleteRebuild 2. _fldAlwaysRebuild 3. recorded list actions, IDs, indices If so, set _needsCompleteRebuild to true. If not, update action lists (ActSelect and ActNone will be ignored). at 3: A complete rebuild is indicated, if (a) any of the input list connection has been touched (removed/reconnected) (b) an ActNew or ActUnknown event occurred.

virtual void ml::MergeLists::activateAttachments ( ) [virtual]

Update fields after an initialization without handleNotification() called.

Reimplemented from ml::FieldContainer.

virtual void ml::MergeLists::handleNotification ( Field field) [virtual]

Handle field notifications.

Reimplemented from ml::Module.


Member Data Documentation

Always rebuild output list from scratch (instead of modifying it)

Definition at line 111 of file mlMergeLists.h.

Determines auto-update mode.

Definition at line 109 of file mlMergeLists.h.

Deletes the output object.

Definition at line 110 of file mlMergeLists.h.

Input list fields, initialized by derived class.

Definition at line 105 of file mlMergeLists.h.

Notify output list on each input list event (only for AutoApply and AlwaysRebuild OFF)

Definition at line 112 of file mlMergeLists.h.

Output list field, initialized by derived class.

Definition at line 104 of file mlMergeLists.h.

Rebuild output list.

Definition at line 107 of file mlMergeLists.h.

std::vector<MLssize_t> ml::MergeLists::_inputItemIdList[2] [protected]

Remember ids of each input list and their corresponding output ids.

This is necessary because items removed due to overflow (ActInsertOvw) can only be found via their id.

Definition at line 127 of file mlMergeLists.h.

remember action classes for each input list since last complete rebuild

Definition at line 117 of file mlMergeLists.h.

std::vector<MLssize_t> ml::MergeLists::_listActionIdList[2] [protected]

remember action IDs for each input list since last complete rebuild

Definition at line 120 of file mlMergeLists.h.

std::vector<MLssize_t> ml::MergeLists::_listActionIndexList[2] [protected]

remember action indices for each input list since last complete rebuild

Definition at line 123 of file mlMergeLists.h.

flag indicating whether a new output list is needed

Definition at line 132 of file mlMergeLists.h.

const char* ml::MergeLists::AutoUpdateModeNames[] [static, protected]

auto update mode tokens

Definition at line 130 of file mlMergeLists.h.


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