ICF 3.1.1.10
Technical documentation of ICF Libraries
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:
Collaboration diagram for imod::CModelUpdateBridge:

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 (CModelUpdateBridge &&bridge) noexcept
 
 CModelUpdateBridge (istd::IChangeable *changeablePtr, int updateFlags=UF_DELEGATED)
 
virtual ~CModelUpdateBridge ()
 
imod::IModelGetObservedModel (int modelIndex) const
 Get access to connected model with the index index.
 
int GetModelCount () const
 Gets the number of connected models.
 
void EnsureModelsDetached ()
 Remove all observed models from this bridge.
 
bool IsModelAttached (const imod::IModel *modelPtr) const override
 Check if specified model is attached.
 
bool OnModelAttached (imod::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 (imod::IModel *modelPtr) override
 This call back function will be called, if an observable object is about to be detached.
 
void BeforeModelChange (imod::IModel *modelPtr) override
 This function will be called before update of the observer contents occures.
 
void AfterModelChange (imod::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

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 32 of file CModelUpdateBridge.h.

Member Enumeration Documentation

◆ UpdateFlags

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 38 of file CModelUpdateBridge.h.

Constructor & Destructor Documentation

◆ CModelUpdateBridge() [1/2]

imod::CModelUpdateBridge::CModelUpdateBridge ( CModelUpdateBridge && bridge)
noexcept

◆ CModelUpdateBridge() [2/2]

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

◆ ~CModelUpdateBridge()

virtual imod::CModelUpdateBridge::~CModelUpdateBridge ( )
virtual

Member Function Documentation

◆ AfterModelChange()

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

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

Implements imod::IObserver.

◆ BeforeModelChange()

void imod::CModelUpdateBridge::BeforeModelChange ( imod::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::CModelUpdateBridge::EnsureModelsDetached ( )

Remove all observed models from this bridge.

◆ GetModelCount()

int imod::CModelUpdateBridge::GetModelCount ( ) const

Gets the number of connected models.


◆ GetObservedModel()

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

Get access to connected model with the index index.

◆ IsModelAttached()

bool imod::CModelUpdateBridge::IsModelAttached ( const imod::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::CModelUpdateBridge::OnModelAttached ( imod::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.

◆ OnModelDetached()

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

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:

© Witold Gantzke and Kirill Lepskiy