Public Member Functions | List of all members
imod::IModel Class Referenceabstract

Common interface for model objects, that supports Model/Observer design pattern. More...

#include <IModel.h>

Inheritance diagram for imod::IModel:
istd::IPolymorphic imod::CModelBase imod::CModelProxy imod::TModelWrap< Base > imod::TModelWrap< CommandsProvider > imod::TModelWrap< CurrentFile > imod::TModelWrap< DocumentInfo > imod::TModelWrap< DocumentSelectionInfo > imod::TModelWrap< ibase::ICommandsProvider > imod::TModelWrap< iimg::CBitmap > imod::TModelWrap< iprm::CEnableableParam > imod::TModelWrap< iprm::CParamsManagerCompBase::SelectedParams > imod::TModelWrap< iqtgui::CGuiComponentBase::VisualStatus > imod::TModelWrap< PageModel > imod::TModelWrap< RuntimeStatus > imod::TModelWrap< TExtMessage< Element > > imod::TModelWrap< VisibleWindowsManager >

Public Member Functions

virtual bool AttachObserver (IObserver *observerPtr)=0
 Attaches model object to observer observerPtr. More...
 
virtual void DetachObserver (IObserver *observerPtr)=0
 Detaches model object from observer observerPtr. More...
 
virtual void DetachAllObservers ()=0
 Detaches all attached observers. More...
 
virtual bool IsAttached (const IObserver *observerPtr) const =0
 Returns true if observer observer is attached to this model object. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Detailed Description

Common interface for model objects, that supports Model/Observer design pattern.

See Also
IObserver

Definition at line 23 of file IModel.h.

Member Function Documentation

virtual bool imod::IModel::AttachObserver ( IObserver observerPtr)
pure virtual

Attaches model object to observer observerPtr.

Warning
Please note, that double call of this function for the same observer will cause an assertion.
Parameters
observerPtrobserver, cannot be NULL.

Implemented in imod::CModelBase, and imod::CModelProxy.

Referenced by imod::TSingleModelObserverBase< ModelInterface >::AttachOrSetObject(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::CreateShape(), and iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelAttached().

virtual void imod::IModel::DetachAllObservers ( )
pure virtual

Detaches all attached observers.

Implemented in imod::CModelBase, and imod::CModelProxy.

virtual void imod::IModel::DetachObserver ( IObserver observerPtr)
pure virtual

Detaches model object from observer observerPtr.

Warning
Please note, that call of this function for the observer which is not attached to the observer observer will cause an assertion. To prevent this, you can use the isAttached() function.

Implemented in imod::CModelBase, and imod::CModelProxy.

Referenced by iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelDetached().

virtual bool imod::IModel::IsAttached ( const IObserver observerPtr) const
pure virtual

Returns true if observer observer is attached to this model object.

Implemented in imod::CModelBase, and imod::CModelProxy.

Referenced by iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelDetached().


The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy