Classes | Public Member Functions | Protected Member Functions | List of all members
imod::CMultiModelDispatcherBase Class Referenceabstract

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

#include <CMultiModelDispatcherBase.h>

Inheritance diagram for imod::CMultiModelDispatcherBase:
istd::IPolymorphic idoc::CMultiDocumentManagerBase::SingleDocumentData ifile::CAutoPersistenceComp ifile::CFileSystemInfoProviderComp ifilegui::CFileSystemExplorerGuiComp ifilegui::CFileTreeViewGuiComp iqt2d::CMultiBitmapViewComp iqt2d::CViewProviderGuiComp iqtgui::CCommandsBinderComp iqtgui::CMultiPageGuiCompBase iqtgui::CSimpleMainWindowGuiComp::CommandsObserver iqtprm::COptionsManagerGuiComp iqtprm::CSelectionParamGuiComp

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. More...
 
void UnregisterModel (int modelId=0)
 Unregister the data model object. More...
 
void UnregisterAllModels ()
 Unregister all observed data objects. More...
 
template<class Object >
Object * GetObjectAt (int modelId) const
 Get concrete object instance of the obsered model. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

virtual void OnModelChanged (int modelId, const istd::IChangeable::ChangeSet &changeSet)=0
 

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 30 of file CMultiModelDispatcherBase.h.

Member Function Documentation

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

Get concrete object instance of the obsered model.

Definition at line 91 of file CMultiModelDispatcherBase.h.

References NULL.

virtual void imod::CMultiModelDispatcherBase::OnModelChanged ( int  modelId,
const istd::IChangeable::ChangeSet changeSet 
)
protectedpure virtual
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.
void imod::CMultiModelDispatcherBase::UnregisterAllModels ( )

Unregister all observed data objects.

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:

© 2007-2017 Witold Gantzke and Kirill Lepskiy