6#ifndef imod_CMultiModelObserverBase_included
7#define imod_CMultiModelObserverBase_included
11#include <QtCore/QVector>
12#include <QtCore/QReadWriteLock>
79 typedef QVector<IModel*> Models;
84 mutable QReadWriteLock m_mutex;
Basic implementation of a multiple model observer.
void BeforeModelChange(IModel *modelPtr) override
This function will be called before update of the observer contents occures.
void SetObservedIds(const istd::IChangeable::ChangeSet &changeMask)
Set list of ID's beeing observed.
void AfterModelChange(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
This function will be called after update of the observer contents occures.
virtual void OnUpdate(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
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.
int GetModelCount() const
Gets the number of connected models.
bool IsModelAttached(const IModel *modelPtr) const override
Check if specified model is attached.
void EnsureModelsDetached()
Ensure all attached models are detached.
IModel * GetObservedModel(int modelIndex) const
Get access to connected model with the index index.
bool OnModelDetached(IModel *modelPtr) override
This call back function will be called, if an observable object is about to be detached.
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...