Public Member Functions | Protected Member Functions | List of all members
imod::CMultiModelObserverBase Class Reference

Basic implementation of a multiple model observer. More...

#include <CMultiModelObserverBase.h>

Inheritance diagram for imod::CMultiModelObserverBase:
imod::IObserver istd::IPolymorphic imod::TMultiModelObserverBase< ModelInterface >

Public Member Functions

 CMultiModelObserverBase ()
 
virtual ~CMultiModelObserverBase ()
 
int GetModelCount () const
 Gets the number of connected models. More...
 
IModelGetObservedModel (int modelIndex) const
 Get access to connected model with the index index. More...
 
IModelGetModelPtr (int modelIndex) const
 Get access to connected model with the index index. More...
 
void EnsureModelsDetached ()
 Ensure all attached models are detached. More...
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed. More...
 
virtual bool IsModelAttached (const IModel *modelPtr) const
 Check if specified model is attached. More...
 
virtual bool OnModelAttached (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 (IModel *modelPtr)
 This call back function will be called, if an observable object is about to be detached. More...
 
virtual void BeforeUpdate (IModel *modelPtr)
 This function will be called before update of the observer contents occures. More...
 
virtual void AfterUpdate (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 ()
 

Protected Member Functions

virtual void OnUpdate (IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
 Called on update of observed model. More...
 

Detailed Description

Basic implementation of a multiple model observer.

Definition at line 22 of file CMultiModelObserverBase.h.

Constructor & Destructor Documentation

imod::CMultiModelObserverBase::CMultiModelObserverBase ( )
virtual imod::CMultiModelObserverBase::~CMultiModelObserverBase ( )
virtual

Member Function Documentation

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

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

Implements imod::IObserver.

virtual void imod::CMultiModelObserverBase::BeforeUpdate ( 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.

void imod::CMultiModelObserverBase::EnsureModelsDetached ( )

Ensure all attached models are detached.

If there are some attached models they will be detached and removed from observed list.

int imod::CMultiModelObserverBase::GetModelCount ( ) const

Gets the number of connected models.

IModel* imod::CMultiModelObserverBase::GetModelPtr ( int  modelIndex) const

Get access to connected model with the index index.

Deprecated:
use GetObservedModel instead.
IModel* imod::CMultiModelObserverBase::GetObservedModel ( int  modelIndex) const

Get access to connected model with the index index.

Parameters
modelIndexindex of model.
virtual bool imod::CMultiModelObserverBase::IsModelAttached ( const 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::CMultiModelObserverBase::OnModelAttached ( 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.

Reimplemented in imod::TMultiModelObserverBase< ModelInterface >.

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

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

Implements imod::IObserver.

virtual void imod::CMultiModelObserverBase::OnUpdate ( IModel modelPtr,
const istd::IChangeable::ChangeSet changeSet 
)
protectedvirtual

Called on update of observed model.

This method is designed to be overload by derrived classes.

void imod::CMultiModelObserverBase::SetObservedIds ( const istd::IChangeable::ChangeSet changeMask)

Set list of ID's beeing observed.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy