IObserver.h
Go to the documentation of this file.
1 #ifndef imod_IObserver_included
2 #define imod_IObserver_included
3 
4 
5 // ACF includes
6 #include <istd/IPolymorphic.h>
7 #include <istd/IChangeable.h>
8 #include <imod/imod.h>
9 
10 
11 namespace imod
12 {
13 
14 
15 class IModel;
16 
17 
24 class IObserver: virtual public istd::IPolymorphic
25 {
26 public:
32  virtual bool IsModelAttached(const IModel* modelPtr = NULL) const = 0;
41  virtual bool OnModelAttached(IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask) = 0;
42 
46  virtual bool OnModelDetached(IModel* modelPtr) = 0;
47 
52  virtual void BeforeUpdate(IModel* modelPtr) = 0;
53 
57  virtual void AfterUpdate(IModel* modelPtr, const istd::IChangeable::ChangeSet& changeSet) = 0;
58 };
59 
60 
61 } // namespace imod
62 
63 
64 #endif // !imod_IObserver_included
65 
66 
virtual void AfterUpdate(IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)=0
This function will be called after update of the observer contents occures.
virtual bool OnModelDetached(IModel *modelPtr)=0
This call back function will be called, if an observable object is about to be detached.
Base interface for all used interfaces and implementations.
Definition: IPolymorphic.h:17
#define NULL
Definition: istd.h:64
virtual void BeforeUpdate(IModel *modelPtr)=0
This function will be called before update of the observer contents occures.
virtual bool IsModelAttached(const IModel *modelPtr=NULL) const =0
Check if specified model is attached.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition: IObserver.h:24
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
virtual bool OnModelAttached(IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)=0
This call back function will be called, if an observable object is about to be attached.

© 2007-2017 Witold Gantzke and Kirill Lepskiy