ICF 3.1.1.10
Technical documentation of ICF Libraries
IModel.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef imod_IModel_included
7#define imod_IModel_included
8
9
10// ICF includes
11#include <istd/IChangeable.h>
12#include <imod/imod.h>
13
14
15namespace imod
16{
17
18
19class IObserver;
20
21
28class IModel: virtual public istd::IPolymorphic
29{
30public:
37 virtual bool AttachObserver(IObserver* observerPtr) = 0;
38
45 virtual void DetachObserver(IObserver* observerPtr) = 0;
46
50 virtual void DetachAllObservers() = 0;
51
55 virtual bool IsAttached(const IObserver* observerPtr) const = 0;
56};
57
58
59} // namespace imod
60
61
62#endif // !imod_IModel_included
63
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
virtual void DetachAllObservers()=0
Detaches all attached observers.
virtual void DetachObserver(IObserver *observerPtr)=0
Detaches model object from observer observerPtr.
virtual bool AttachObserver(IObserver *observerPtr)=0
Attaches model object to observer observerPtr.
virtual bool IsAttached(const IObserver *observerPtr) const =0
Returns true if observer observer is attached to this model object.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:30
This namespace containes basic implementation of Model/Observer design pattern This package is system...
Definition CModelBase.h:20

© Witold Gantzke and Kirill Lepskiy