101 if (modelPtr ==
NULL){
102 return m_modelPtr !=
NULL;
105 return m_modelPtr == modelPtr;
113 m_modelPtr = modelPtr;
Basic implementation for a single model observer.
imod::IModel * GetModelPtr() const
Get access to observed model.
virtual void AfterUpdate(imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
Callback invoked after an update of the observer's content occurs.
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
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.
static const istd::IChangeable::ChangeSet s_undoChanges
virtual void BeforeUpdate(imod::IModel *modelPtr) override
Callback invoked before an update of the observer's content occurs.
void SetObservedIds(const istd::IChangeable::ChangeSet &changeMask)
Set list of ID's beeing observed.
virtual bool IsModelAttached(const imod::IModel *modelPtr=NULL) const override
Checks if the specified model is currently attached to this observer.
void EnsureModelDetached()
Make sure this observer is detached.
virtual ~CSingleModelObserverBase()
void SetModelPtr(imod::IModel *modelPtr)
Set internal model pointer to specified value.
virtual bool OnModelDetached(imod::IModel *modelPtr) override
Callback invoked when an observable model is about to be detached from this observer.
imod::IModel * GetObservedModel() const
Get access to observed model.
CSingleModelObserverBase()
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...