![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Basic implementation of a multiple model observer. More...
#include <CMultiModelObserverBase.h>
Public Member Functions | |
CMultiModelObserverBase () | |
virtual | ~CMultiModelObserverBase () |
int | GetModelCount () const |
Gets the number of connected models. | |
IModel * | GetObservedModel (int modelIndex) const |
Get access to connected model with the index index . | |
IModel * | GetModelPtr (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. | |
![]() |
Protected Member Functions | |
virtual void | OnUpdate (IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) |
Called on update of observed model. | |
Basic implementation of a multiple model observer.
Definition at line 28 of file CMultiModelObserverBase.h.
imod::CMultiModelObserverBase::CMultiModelObserverBase | ( | ) |
|
virtual |
|
overridevirtual |
This function will be called after update of the observer contents occures.
Implements imod::IObserver.
Reimplemented in iinsp::CInspectionTaskComp::TaskStatusObserver.
|
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.
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
.
IModel * imod::CMultiModelObserverBase::GetObservedModel | ( | int | modelIndex | ) | const |
Get access to connected model with the index index
.
modelIndex | index of model. |
|
overridevirtual |
Check if specified model is attached.
\modelPtr pointer to model object. If this pointer is nullptr, any model is meaned.
modelPtr
is attached yet to this observer, false otherwise. Implements imod::IObserver.
|
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.
modelPtr | pointer to model object being attached. |
changeMask | output parameter returning set of change ID's will be accepted. returns a false . |
Implements imod::IObserver.
Reimplemented in imod::TMultiModelObserverBase< ModelInterface >.
|
overridevirtual |
This call back function will be called, if an observable object is about to be detached.
Implements imod::IObserver.
|
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.
© Witold Gantzke and Kirill Lepskiy