6#include <QtCore/QVector>
7#include <QtCore/QMutex>
74 typedef QVector<IModel*> Models;
79#if QT_VERSION >= 0x060000
80 mutable QRecursiveMutex m_mutex;
82 mutable QMutex m_mutex;
Basic implementation of a multiple model observer.
virtual void BeforeUpdate(IModel *modelPtr) override
Callback invoked before an update of the observer's content occurs.
virtual bool IsModelAttached(const IModel *modelPtr) const override
Checks if the specified model is currently attached to this observer.
void SetObservedIds(const istd::IChangeable::ChangeSet &changeMask)
Set list of ID's beeing observed.
virtual void OnUpdate(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
int GetModelCount() const
Gets the number of connected models.
void EnsureModelsDetached()
Ensure all attached models are detached.
virtual void AfterUpdate(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
Callback invoked after an update of the observer's content occurs.
virtual bool OnModelAttached(IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
Callback invoked when an observable model is about to be attached to this observer.
virtual bool OnModelDetached(IModel *modelPtr) override
Callback invoked when an observable model is about to be detached from this observer.
IModel * GetObservedModel(int modelIndex) const
Get access to connected model with the index index.
virtual ~CMultiModelObserverBase()
IModel * GetModelPtr(int modelIndex) const
Get access to connected model with the index index.
CMultiModelObserverBase()
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).
This namespace containes basic implementation of Model/Observer design pattern This package is system...