6#include <QtCore/QVector>
7#include <QtCore/QReadWriteLock>
76 typedef QVector<imod::IModel*> Models;
83 mutable QReadWriteLock m_modelListMutex;
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
virtual void BeforeUpdate(imod::IModel *modelPtr) override
Callback invoked before an update of the observer's content occurs.
CModelUpdateBridge(istd::IChangeable *changeablePtr, int updateFlags=UF_DELEGATED)
virtual bool OnModelDetached(imod::IModel *modelPtr) override
Callback invoked when an observable model is about to be detached from this observer.
virtual void AfterUpdate(imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
Callback invoked after an update of the observer's content occurs.
void EnsureModelsDetached()
Remove all observed models from this bridge.
UpdateFlags
Flags to control the change set using for the change notification of the target object.
@ UF_DELEGATED
Change notification of the target object will be done using change set containing CF_DELEGATED flag o...
@ UF_SOURCE
Change notification of the target object will be done using change set of observered object.
imod::IModel * GetObservedModel(int modelIndex) const
Get access to connected model with the index index.
int GetModelCount() const
Gets the number of connected models.
virtual ~CModelUpdateBridge()
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
Callback invoked when an observable model is about to be attached to this observer.
virtual bool IsModelAttached(const imod::IModel *modelPtr) const override
Checks if the specified model is currently attached to this observer.
Common interface for model objects, that supports Model/Observer design pattern.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Set of change flags (its IDs).
Common interface for data model objects, which can be changed.
This namespace containes basic implementation of Model/Observer design pattern This package is system...