Public Types | Public Member Functions | Protected Member Functions | List of all members
imod::CModelBase Class Referenceabstract

Basic implementation of a model. More...

#include <CModelBase.h>

Inheritance diagram for imod::CModelBase:
imod::IModel istd::IPolymorphic 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 Types

typedef QSet< IObserver * > Observers
 

Public Member Functions

 CModelBase ()
 
virtual ~CModelBase ()
 
virtual int GetObserverCount () const
 Returns count of connected observers. More...
 
virtual Observers GetObservers () const
 Returns set of all observers. More...
 
const
istd::IChangeable::ChangeSet
GetCumulatedChanges () const
 
virtual bool AttachObserver (imod::IObserver *observerPtr)
 Attaches model object to observer observerPtr. More...
 
virtual void DetachObserver (imod::IObserver *observerPtr)
 Detaches model object from observer observerPtr. More...
 
virtual void DetachAllObservers ()
 Detaches all attached observers. More...
 
virtual bool IsAttached (const imod::IObserver *observerPtr) const
 Returns true if observer observer is attached to this model object. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

void NotifyBeforeChange (const istd::IChangeable::ChangeSet &changeSet, bool isGroup)
 Called before each change. More...
 
void NotifyAfterChange (const istd::IChangeable::ChangeSet &changeSet)
 Called after each change. More...
 
virtual void OnBeginGlobalChanges ()=0
 Called before global changes will be started. More...
 
virtual void OnEndGlobalChanges (const istd::IChangeable::ChangeSet &changeSet)=0
 Called after global changes are finished. More...
 

Detailed Description

Basic implementation of a model.

Definition at line 23 of file CModelBase.h.

Member Typedef Documentation

Definition at line 26 of file CModelBase.h.

Constructor & Destructor Documentation

imod::CModelBase::CModelBase ( )
virtual imod::CModelBase::~CModelBase ( )
virtual

Member Function Documentation

virtual bool imod::CModelBase::AttachObserver ( imod::IObserver observerPtr)
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.

Implements imod::IModel.

virtual void imod::CModelBase::DetachAllObservers ( )
virtual

Detaches all attached observers.

Implements imod::IModel.

Referenced by icomp::TModelCompWrap< Base >::OnComponentDestroyed().

virtual void imod::CModelBase::DetachObserver ( imod::IObserver observerPtr)
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.

Implements imod::IModel.

const istd::IChangeable::ChangeSet & imod::CModelBase::GetCumulatedChanges ( ) const
inline

Definition at line 122 of file CModelBase.h.

virtual int imod::CModelBase::GetObserverCount ( ) const
virtual

Returns count of connected observers.

virtual Observers imod::CModelBase::GetObservers ( ) const
virtual

Returns set of all observers.

virtual bool imod::CModelBase::IsAttached ( const imod::IObserver observerPtr) const
virtual

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

Implements imod::IModel.

void imod::CModelBase::NotifyAfterChange ( const istd::IChangeable::ChangeSet changeSet)
protected

Called after each change.

Returns
true, if end notification was done.
void imod::CModelBase::NotifyBeforeChange ( const istd::IChangeable::ChangeSet changeSet,
bool  isGroup 
)
protected

Called before each change.

Returns
true, if some notification was done.
virtual void imod::CModelBase::OnBeginGlobalChanges ( )
protectedpure virtual
virtual void imod::CModelBase::OnEndGlobalChanges ( const istd::IChangeable::ChangeSet changeSet)
protectedpure virtual

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

© 2007-2017 Witold Gantzke and Kirill Lepskiy