ACF $AcfVersion:0$
IObserver.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <istd/IPolymorphic.h>
7#include <istd/IChangeable.h>
8#include <imod/imod.h>
9
10
11namespace imod
12{
13
14
15class IModel;
16
17
155class IObserver: virtual public istd::IPolymorphic
156{
157public:
184 virtual bool IsModelAttached(const IModel* modelPtr = NULL) const = 0;
185
231 virtual bool OnModelAttached(IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask) = 0;
232
266 virtual bool OnModelDetached(IModel* modelPtr) = 0;
267
297 virtual void BeforeUpdate(IModel* modelPtr) = 0;
298
343 virtual void AfterUpdate(IModel* modelPtr, const istd::IChangeable::ChangeSet& changeSet) = 0;
344};
345
346
348
349
350} // namespace imod
351
352
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
virtual bool OnModelAttached(IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)=0
Callback invoked when an observable model is about to be attached to this observer.
virtual void BeforeUpdate(IModel *modelPtr)=0
Callback invoked before an update of the observer's content occurs.
virtual void AfterUpdate(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)=0
Callback invoked after an update of the observer's content occurs.
virtual bool IsModelAttached(const IModel *modelPtr=NULL) const =0
Checks if the specified model is currently attached to this observer.
virtual bool OnModelDetached(IModel *modelPtr)=0
Callback invoked when an observable model is about to be detached from this observer.
Set of change flags (its IDs).
Definition IChangeable.h:36
Base interface for all used interfaces and implementations.
Unique ownership smart pointer for interface types.
#define NULL
Definition istd.h:74
This namespace containes basic implementation of Model/Observer design pattern This package is system...
Definition CModelBase.h:16
istd::TUniqueInterfacePtr< imod::IObserver > IObserverPtr
Definition IObserver.h:347