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... | |
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.
typedef _MessageType Base::Subject< _MessageType >::MessageType |
typedef Observer<_MessageType> Base::Subject< _MessageType >::ObserverType |
typedef Subject<_MessageType> Base::Subject< _MessageType >::SubjectType |
Base::Subject< _MessageType >::Subject | ( | ) |
A constructor.
No special function so far.
|
virtual |
A destructor.
No special function so far.
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.
ToObserv | A pointer to a concrete Observer |
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().
void Base::Subject< _MessageType >::ClearObserver | ( | ) |
Clears the list of all registered observers.
void Base::Subject< _MessageType >::Detach | ( | Observer< _MessageType > * | ToObserv | ) |
Detach an Observer Detach an Observer from the list of Observers which get called when Notify is called.
ToObserv | A pointer to a concrete Observer |
Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), FemGui::ViewProviderFemPostObject::attach(), Gui::AbstractSplitView::~AbstractSplitView(), SketcherGui::CurveConverter::~CurveConverter(), Gui::Dialog::DlgDisplayPropertiesImp::~DlgDisplayPropertiesImp(), Gui::EditorView::~EditorView(), Gui::GraphicsView3D::~GraphicsView3D(), NaviCubeImplementation::~NaviCubeImplementation(), Gui::PrefWidget::~PrefWidget(), Gui::RecentFilesAction::Private::~Private(), Gui::PythonConsole::~PythonConsole(), Gui::PythonEditor::~PythonEditor(), Gui::DockWnd::ReportOutput::~ReportOutput(), 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::View3DInventor::~View3DInventor(), FemGui::ViewProviderFemPostObject::~ViewProviderFemPostObject(), InspectionGui::ViewProviderInspection::~ViewProviderInspection(), and MeshGui::ViewProviderMeshCurvature::~ViewProviderMeshCurvature().
Observer< _MessageType > * Base::Subject< _MessageType >::Get | ( | const char * | Name | ) |
void Base::Subject< _MessageType >::Notify | ( | _MessageType | rcReason | ) |
Notify all Observers Send a message to all Observers attached to this subject.
The Message depends on the implementation of a concrete Oberserver and Subject.
References Base::Console(), and Base::ConsoleSingleton::Error().
Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), FemGui::ViewProviderFemPostObject::attach(), InspectionGui::ViewProviderInspection::onChanged(), Gui::PrefWidget::onSave(), Gui::DockWnd::ReportOutput::ReportOutput(), and InspectionGui::ViewProviderInspection::updateData().