IModel.h
Go to the documentation of this file.
1 #ifndef imod_IModel_included
2 #define imod_IModel_included
3 
4 
5 // ACF includes
6 #include <istd/IChangeable.h>
7 #include <imod/imod.h>
8 
9 
10 namespace imod
11 {
12 
13 
14 class IObserver;
15 
16 
23 class IModel: virtual public istd::IPolymorphic
24 {
25 public:
32  virtual bool AttachObserver(IObserver* observerPtr) = 0;
33 
40  virtual void DetachObserver(IObserver* observerPtr) = 0;
41 
45  virtual void DetachAllObservers() = 0;
46 
50  virtual bool IsAttached(const IObserver* observerPtr) const = 0;
51 };
52 
53 
54 } // namespace imod
55 
56 
57 #endif // !imod_IModel_included
58 
virtual bool IsAttached(const IObserver *observerPtr) const =0
Returns true if observer observer is attached to this model object.
Base interface for all used interfaces and implementations.
Definition: IPolymorphic.h:17
virtual void DetachAllObservers()=0
Detaches all attached observers.
virtual bool AttachObserver(IObserver *observerPtr)=0
Attaches model object to observer observerPtr.
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
virtual void DetachObserver(IObserver *observerPtr)=0
Detaches model object from observer observerPtr.

© 2007-2017 Witold Gantzke and Kirill Lepskiy