ICF 3.0.5.47
Technical documentation of ICF Libraries
imod::CMultiModelObserverBase Class Reference

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

#include <CMultiModelObserverBase.h>

Inheritance diagram for imod::CMultiModelObserverBase:
Collaboration diagram for imod::CMultiModelObserverBase:

Public Member Functions

 CMultiModelObserverBase ()
 
virtual ~CMultiModelObserverBase ()
 
int GetModelCount () const
 Gets the number of connected models.
 
IModelGetObservedModel (int modelIndex) const
 Get access to connected model with the index index.
 
IModelGetModelPtr (int modelIndex) const
 Get access to connected model with the index index.
 
void EnsureModelsDetached ()
 Ensure all attached models are detached.
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed.
 
bool IsModelAttached (const IModel *modelPtr) const override
 Check if specified model is attached.
 
bool OnModelAttached (IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
 This call back function will be called, if an observable object is about to be attached.
 
bool OnModelDetached (IModel *modelPtr) override
 This call back function will be called, if an observable object is about to be detached.
 
void BeforeModelChange (IModel *modelPtr) override
 This function will be called before update of the observer contents occures.
 
void AfterModelChange (IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
 This function will be called after update of the observer contents occures.
 
- Public Member Functions inherited from imod::IObserver

Protected Member Functions

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

Detailed Description

Basic implementation of a multiple model observer.

Definition at line 28 of file CMultiModelObserverBase.h.

Constructor & Destructor Documentation

◆ CMultiModelObserverBase()

imod::CMultiModelObserverBase::CMultiModelObserverBase ( )

◆ ~CMultiModelObserverBase()

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

Member Function Documentation

◆ AfterModelChange()

void imod::CMultiModelObserverBase::AfterModelChange ( IModel * modelPtr,
const istd::IChangeable::ChangeSet & changeSet )
overridevirtual

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

Implements imod::IObserver.

Reimplemented in iinsp::CInspectionTaskComp::TaskStatusObserver.

◆ BeforeModelChange()

void imod::CMultiModelObserverBase::BeforeModelChange ( IModel * modelPtr)
overridevirtual

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

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

Implements imod::IObserver.

◆ EnsureModelsDetached()

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.

◆ GetModelCount()

int imod::CMultiModelObserverBase::GetModelCount ( ) const

Gets the number of connected models.


◆ GetModelPtr()

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

Get access to connected model with the index index.

◆ GetObservedModel()

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

Get access to connected model with the index index.

Parameters
modelIndexindex of model.

◆ IsModelAttached()

bool imod::CMultiModelObserverBase::IsModelAttached ( const IModel * modelPtr) const
overridevirtual

Check if specified model is attached.

\modelPtr pointer to model object. If this pointer is nullptr, any model is meaned.

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

Implements imod::IObserver.

◆ OnModelAttached()

bool imod::CMultiModelObserverBase::OnModelAttached ( IModel * modelPtr,
istd::IChangeable::ChangeSet & changeMask )
overridevirtual

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 >.

◆ OnModelDetached()

bool imod::CMultiModelObserverBase::OnModelDetached ( IModel * modelPtr)
overridevirtual

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

Implements imod::IObserver.

◆ OnUpdate()

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.

◆ SetObservedIds()

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:

© Witold Gantzke and Kirill Lepskiy