ICF 3.0.5.47
Technical documentation of ICF Libraries
imod::CModelBase Class Referenceabstract

Basic implementation of a model. More...

#include <CModelBase.h>

Inherits imod::IModel.

Inherited by imod::TModelWrap< imeas::CSimpleSamplesSequence32 >, imod::TModelWrap< TExtMessage< Element > >, imod::TModelWrap< ilog::CMessageContainer >, imod::TModelWrap< iimg::CBitmap >, imod::TModelWrap< RuntimeStatus >, imod::TModelWrap< CameraList >, imod::TModelWrap< MetaInfoManager >, imod::TModelWrap< icmpstr::CPackagesLoaderExtComp::ParamsManager >, imod::TModelWrap< SelectionInfoImpl >, imod::TModelWrap< DocumentInfo >, imod::TModelWrap< CurrentView >, imod::TModelWrap< DocumentSelectionInfo >, imod::TModelWrap< CurrentFile >, imod::TModelWrap< Parameters >, imod::TModelWrap< Status >, imod::TModelWrap< iprm::COptionsManager >, imod::TModelWrap< CalibrationList >, imod::TModelWrap< imeas::CGeneralDataSequence >, imod::TModelWrap< iiprgui::CMultiLineSupplierGuiComp::LineSelection >, imod::TModelWrap< i2d::CCircle >, imod::TModelWrap< i2d::CLine2d >, imod::TModelWrap< iprm::CEnableableParam >, imod::TModelWrap< iprm::CParamsManagerCompBase::SelectedParams >, imod::TModelWrap< CommandsProvider >, imod::TModelWrap< istdgui::CGuiComponentBase::VisualStatus >, imod::TModelWrap< PageModel >, imod::TModelWrap< VisibleWindowsManager >, and imod::TModelWrap< Base >.

Collaboration diagram for imod::CModelBase:

Public Types

typedef QSet< IObserver * > Observers
 

Public Member Functions

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

Protected Member Functions

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

Detailed Description

Basic implementation of a model.

Definition at line 28 of file CModelBase.h.

Member Typedef Documentation

◆ Observers

Definition at line 31 of file CModelBase.h.

Constructor & Destructor Documentation

◆ CModelBase()

imod::CModelBase::CModelBase ( )

◆ ~CModelBase()

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

Member Function Documentation

◆ AttachObserver()

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 nullptr.

Implements imod::IModel.

◆ DetachAllObservers()

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

Detaches all attached observers.

Implements imod::IModel.

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

◆ DetachObserver()

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.

◆ GetCumulatedChanges()

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

Definition at line 129 of file CModelBase.h.

◆ GetObserverCount()

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

Returns count of connected observers.

◆ GetObservers()

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

Returns set of all observers.

◆ IsAttached()

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.

◆ NotifyAfterChange()

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

Called after each change.

Returns
true, if end notification was done.

◆ NotifyBeforeChange()

void imod::CModelBase::NotifyBeforeChange ( const istd::IChangeable::ChangeSet & changeSet,
bool isGroup )
protected

Called before each change.

Returns
true, if some notification was done.

◆ OnBeginGlobalChanges()

◆ OnEndGlobalChanges()


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

© Witold Gantzke and Kirill Lepskiy