ICF 3.0.5.47
Technical documentation of ICF Libraries
imod::CMultiModelDispatcherBase Class Referenceabstract

Generic implementation of a data model changes notifier. More...

#include <CMultiModelDispatcherBase.h>

Inherits istd::IPolymorphic.

Inherited by i2dgui::CMultiBitmapViewComp [protected], i2dgui::CViewProviderGuiComp [protected], iauthgui::CUserControllerGuiComp [protected], ibase::CTranslationManagerComp [protected], icalib::CComposedAffineCalibrationComp [protected], icalibgui::CPerspectiveCalibEditorComp [protected], icalibgui::CSimpleLensCorrectionEditorComp [protected], icmpstr::CComponentNoteEditorComp [protected], icmpstr::CRegistryStatisticsViewComp [protected], icmpstr::CRegistryTreeViewComp [protected], icmpstr::CRootRegistryGuiComp [protected], icmpstr::CVisualRegistryEditorComp [protected], idoc::CMultiDocumentManagerBase::SingleDocumentData, ifile::CAutoPersistenceComp [protected], ifile::CFileSystemInfoProviderComp [protected], ifilegui::CFileSystemExplorerGuiComp [protected], ifilegui::CFileTreeViewGuiComp, iinspgui::CInspectionTaskGuiComp [protected], iinspgui::CMessageBasedViewExtenderComp [private], iiprgui::CMultiLineSupplierGuiComp::CShape [protected], iloggui::CLogGuiComp [protected], imeasgui::CNumericParamsGuiComp [protected], iprm::CManagerParamsSetShadowerComp [protected], iprmgui::COptionsManagerGuiComp [protected], iprmgui::CParamsPresetEditorComp [protected], iprmgui::CSelectionParamGuiComp [protected], iprocgui::CDocumentProcessingManagerCompBase [protected], istdgui::CCommandsBinderComp [protected], istdgui::CMultiPageGuiCompBase [protected], and istdgui::CSimpleMainWindowGuiComp::CommandsObserver.

Collaboration diagram for imod::CMultiModelDispatcherBase:

Classes

class  ObserverProxy
 

Public Member Functions

bool RegisterModel (IModel *modelPtr, int modelId=0, const istd::IChangeable::ChangeSet &relevantFlags=istd::IChangeable::GetAllChanges())
 Register the data model to be observed.
 
void UnregisterModel (int modelId=0)
 Unregister the data model object.
 
void UnregisterAllModels ()
 Unregister all observed data objects.
 
template<class Object >
Object * GetObjectAt (int modelId) const
 Get concrete object instance of the obsered model.
 

Protected Member Functions

virtual void OnModelChanged (int modelId, const istd::IChangeable::ChangeSet &changeSet)=0
 Called when some model observed by dispatcher will be changed.
 

Detailed Description

Generic implementation of a data model changes notifier.

You can register several data models objects that you want to observe with RegisterModel method. You will get a notification event on each change in the observed data model via OnModelChanged method call of your notification consumer.

Note
Notification consumer class must implement the method void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet& changeSet) to support the notification callback.
See also
imod::CModelUpdateBridge.

Definition at line 34 of file CMultiModelDispatcherBase.h.

Member Function Documentation

◆ GetObjectAt()

template<class Object >
Object * imod::CMultiModelDispatcherBase::GetObjectAt ( int modelId) const

Get concrete object instance of the obsered model.

Definition at line 98 of file CMultiModelDispatcherBase.h.

◆ OnModelChanged()

◆ RegisterModel()

bool imod::CMultiModelDispatcherBase::RegisterModel ( IModel * modelPtr,
int modelId = 0,
const istd::IChangeable::ChangeSet & relevantFlags = istd::IChangeable::GetAllChanges() )

Register the data model to be observed.

If model registration was successfull, the function returns true.

Parameters
modelPtrPointer to the data model object, which should be observed.
modelIdLogical model ID for possible event filtering in the notification callback. Each observed model must be registered with unique ID. If you use the same ID twice, the previous connection will be disconnected.
relefantFlagsThe notification will only be triggered if the value of relevantFlags matches the model change flags.

◆ UnregisterAllModels()

void imod::CMultiModelDispatcherBase::UnregisterAllModels ( )

Unregister all observed data objects.

◆ UnregisterModel()

void imod::CMultiModelDispatcherBase::UnregisterModel ( int modelId = 0)

Unregister the data model object.

Parameters
modelIdobject ID used at the object registration.
See also
RegisterModel

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

© Witold Gantzke and Kirill Lepskiy