Base::Subject< _MessageType > Class Template Reference

Subject class Implementation of the well known Observer Design Pattern. More...

#include <Observer.h>

Public Types

typedef _MessageType MessageType
 
typedef Observer< _MessageType > ObserverType
 
typedef Subject< _MessageType > SubjectType
 

Public Member Functions

void Attach (Observer< _MessageType > *ToObserv)
 Attach an Observer Attach an Observer to the list of Observers which get called when Notify is called. More...
 
void ClearObserver ()
 Clears the list of all registered observers. More...
 
void Detach (Observer< _MessageType > *ToObserv)
 Detach an Observer Detach an Observer from the list of Observers which get called when Notify is called. More...
 
Observer< _MessageType > * Get (const char *Name)
 Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode. More...
 
void Notify (_MessageType rcReason)
 Notify all Observers Send a message to all Observers attached to this subject. More...
 
 Subject ()
 A constructor. More...
 
virtual ~Subject ()
 A destructor. More...
 

Detailed Description

template<class _MessageType>
class Base::Subject< _MessageType >

Subject class Implementation of the well known Observer Design Pattern.

The observed object, which inherit FCSubject, will call all its observers in case of changes. A observer class has to Attach itself to the observed object.

See also
FCObserver

Member Typedef Documentation

◆ MessageType

template<class _MessageType >
typedef _MessageType Base::Subject< _MessageType >::MessageType

◆ ObserverType

template<class _MessageType >
typedef Observer<_MessageType> Base::Subject< _MessageType >::ObserverType

◆ SubjectType

template<class _MessageType >
typedef Subject<_MessageType> Base::Subject< _MessageType >::SubjectType

Constructor & Destructor Documentation

◆ Subject()

template<class _MessageType >
Base::Subject< _MessageType >::Subject ( )

A constructor.

No special function so far.

◆ ~Subject()

template<class _MessageType >
virtual Base::Subject< _MessageType >::~Subject ( )
virtual

A destructor.

No special function so far.

Member Function Documentation

◆ Attach()

template<class _MessageType >
void Base::Subject< _MessageType >::Attach ( Observer< _MessageType > *  ToObserv)

Attach an Observer Attach an Observer to the list of Observers which get called when Notify is called.

Parameters
ToObservA pointer to a concrete Observer
See also
Notify

Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), FemGui::ViewProviderFemPostObject::attach(), SketcherGui::CurveConverter::CurveConverter(), Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::EditorView::EditorView(), Gui::GraphicsView3D::GraphicsView3D(), Gui::MacroManager::MacroManager(), NaviCubeImplementation::NaviCubeImplementation(), TechDrawGui::QGVPage::Private::Private(), Gui::RecentFilesAction::Private::Private(), Gui::PythonConsole::PythonConsole(), Gui::DockWnd::ReportOutput::ReportOutput(), Gui::StatefulLabel::setParameterGroup(), Gui::PrefWidget::setParamGrpPath(), Gui::AbstractSplitView::setupSettings(), Gui::SplitView3DInventor::SplitView3DInventor(), Gui::StatefulLabel::StatefulLabel(), Gui::StatusBarObserver::StatusBarObserver(), Gui::TaskView::TaskAppearance::TaskAppearance(), Gui::TaskView::TaskSelectLinkProperty::TaskSelectLinkProperty(), Gui::TaskView::TaskSketcherCreateCommands::TaskSketcherCreateCommands(), SketcherGui::TaskSketcherGeneral::TaskSketcherGeneral(), Gui::TaskView::TaskView::TaskView(), Gui::TextEditor::TextEditor(), Gui::TreeParams::TreeParams(), Gui::View3DInventor::View3DInventor(), Gui::ViewParams::ViewParams(), FemGui::ViewProviderFemPostObject::ViewProviderFemPostObject(), InspectionGui::ViewProviderInspection::ViewProviderInspection(), and MeshGui::ViewProviderMeshCurvature::ViewProviderMeshCurvature().

◆ ClearObserver()

template<class _MessageType >
void Base::Subject< _MessageType >::ClearObserver ( )

Clears the list of all registered observers.

Note
Using this function in your code may be an indication of design problems.

◆ Detach()

template<class _MessageType >
void Base::Subject< _MessageType >::Detach ( Observer< _MessageType > *  ToObserv)

◆ Get()

template<class _MessageType >
Observer< _MessageType > * Base::Subject< _MessageType >::Get ( const char *  Name)

Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode.

See also
Observer

◆ Notify()

template<class _MessageType >
void Base::Subject< _MessageType >::Notify ( _MessageType  rcReason)

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