Public Types | Public Member Functions | List of all members
imod::CModelUpdateBridge Class Reference

Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself. More...

#include <CModelUpdateBridge.h>

Inheritance diagram for imod::CModelUpdateBridge:
imod::IObserver istd::IPolymorphic iqtgui::CCommandsMultiplexerComp

Public Types

enum  UpdateFlags { UF_DELEGATED = 0x1, UF_SOURCE = 0x2 }
 Flags to control the change set using for the change notification of the target object. More...
 

Public Member Functions

 CModelUpdateBridge (istd::IChangeable *changeablePtr, int updateFlags=UF_DELEGATED)
 
virtual ~CModelUpdateBridge ()
 
imod::IModelGetObservedModel (int modelIndex) const
 Get access to connected model with the index index. More...
 
int GetModelCount () const
 Gets the number of connected models. More...
 
void EnsureModelsDetached ()
 Remove all observed models from this bridge. More...
 
virtual bool IsModelAttached (const imod::IModel *modelPtr) const
 Check if specified model is attached. More...
 
virtual bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
 This call back function will be called, if an observable object is about to be attached. More...
 
virtual bool OnModelDetached (imod::IModel *modelPtr)
 This call back function will be called, if an observable object is about to be detached. More...
 
virtual void BeforeUpdate (imod::IModel *modelPtr)
 This function will be called before update of the observer contents occures. More...
 
virtual void AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
 This function will be called after update of the observer contents occures. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Detailed Description

Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself.

In other words: it allows to connect as observer to multiple models and call BeginChanges and EndChanges on some its changes.

See Also
imod::CMultiModelDispatcherBase.

Definition at line 26 of file CModelUpdateBridge.h.

Member Enumeration Documentation

Flags to control the change set using for the change notification of the target object.

Enumerator
UF_DELEGATED 

Change notification of the target object will be done using change set containing CF_DELEGATED flag only.

UF_SOURCE 

Change notification of the target object will be done using change set of observered object.

Definition at line 32 of file CModelUpdateBridge.h.

Constructor & Destructor Documentation

imod::CModelUpdateBridge::CModelUpdateBridge ( istd::IChangeable changeablePtr,
int  updateFlags = UF_DELEGATED 
)
explicit
virtual imod::CModelUpdateBridge::~CModelUpdateBridge ( )
virtual

Member Function Documentation

virtual void imod::CModelUpdateBridge::AfterUpdate ( imod::IModel modelPtr,
const istd::IChangeable::ChangeSet changeSet 
)
virtual

This function will be called after update of the observer contents occures.

Implements imod::IObserver.

Reimplemented in iqtgui::CCommandsMultiplexerComp.

virtual void imod::CModelUpdateBridge::BeforeUpdate ( imod::IModel modelPtr)
virtual

This function will be called before update of the observer contents occures.

Please note, that in some cases no following AfterUpdate can be called.

Implements imod::IObserver.

Reimplemented in iqtgui::CCommandsMultiplexerComp.

void imod::CModelUpdateBridge::EnsureModelsDetached ( )

Remove all observed models from this bridge.

int imod::CModelUpdateBridge::GetModelCount ( ) const

Gets the number of connected models.

imod::IModel* imod::CModelUpdateBridge::GetObservedModel ( int  modelIndex) const

Get access to connected model with the index index.

virtual bool imod::CModelUpdateBridge::IsModelAttached ( const imod::IModel modelPtr) const
virtual

Check if specified model is attached.

pointer to model object. If this pointer is NULL, any model is meaned.

Returns
true, if modelPtr is attached yet to this observer, false otherwise.

Implements imod::IObserver.

virtual bool imod::CModelUpdateBridge::OnModelAttached ( imod::IModel modelPtr,
istd::IChangeable::ChangeSet changeMask 
)
virtual

This call back function will be called, if an observable object is about to be attached.

This function returns a true, if observable object is accepted by the implementation logic of the observer, otherwise returns false.

Parameters
modelPtrpointer to model object being attached.
changeMaskoutput parameter returning set of change ID's will be accepted. returns a false.

Implements imod::IObserver.

virtual bool imod::CModelUpdateBridge::OnModelDetached ( imod::IModel modelPtr)
virtual

This call back function will be called, if an observable object is about to be detached.

Implements imod::IObserver.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy