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. | |
void | ClearObserver () |
Clears the list of all registered observers. | |
void | Detach (Observer< _MessageType > *ToObserv) |
Detach an Observer Detach an Observer from the list of Observers which get called when Notify is called. | |
Observer< _MessageType > * | Get (const char *Name) |
Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode. | |
void | Notify (_MessageType rcReason) |
Notify all Observers Send a message to all Observers attached to this subject. | |
Subject () | |
A constructor. | |
virtual | ~Subject () |
A destructor. | |
Protected Attributes | |
std::set< Observer < _MessageType > * > | _ObserverSet |
Vector of attached observers. |
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.
Definition at line 99 of file Observer.h.
typedef _MessageType Base::Subject< _MessageType >::MessageType |
Definition at line 104 of file Observer.h.
typedef Observer<_MessageType> Base::Subject< _MessageType >::ObserverType |
Definition at line 103 of file Observer.h.
typedef Subject<_MessageType> Base::Subject< _MessageType >::SubjectType |
Definition at line 105 of file Observer.h.
Base::Subject< _MessageType >::Subject | ( | ) | [inline] |
virtual Base::Subject< _MessageType >::~Subject | ( | ) | [inline, virtual] |
void Base::Subject< _MessageType >::Attach | ( | Observer< _MessageType > * | ToObserv | ) | [inline] |
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 |
Definition at line 132 of file Observer.h.
Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::DockWnd::SelectionView::SelectionView(), Gui::TaskView::TaskAppearance::TaskAppearance(), PartDesignGui::TaskHoleParameters::TaskHoleParameters(), Gui::DockWnd::TaskPanelView::TaskPanelView(), PartDesignGui::TaskPatternRectangularParameters::TaskPatternRectangularParameters(), Gui::TaskView::TaskSelectLinkProperty::TaskSelectLinkProperty(), Gui::TaskView::TaskSketcherCreateCommands::TaskSketcherCreateCommands(), Gui::TaskView::TaskView::TaskView(), and Gui::View3DInventorViewer::View3DInventorViewer().
void Base::Subject< _MessageType >::ClearObserver | ( | ) | [inline] |
Clears the list of all registered observers.
Definition at line 196 of file Observer.h.
void Base::Subject< _MessageType >::Detach | ( | Observer< _MessageType > * | ToObserv | ) | [inline] |
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 |
Definition at line 151 of file Observer.h.
Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), Gui::Dialog::DlgDisplayPropertiesImp::~DlgDisplayPropertiesImp(), Gui::DockWnd::SelectionView::~SelectionView(), Gui::TaskView::TaskAppearance::~TaskAppearance(), PartDesignGui::TaskHoleParameters::~TaskHoleParameters(), Gui::DockWnd::TaskPanelView::~TaskPanelView(), PartDesignGui::TaskPatternRectangularParameters::~TaskPatternRectangularParameters(), Gui::TaskView::TaskSelectLinkProperty::~TaskSelectLinkProperty(), Gui::TaskView::TaskSketcherCreateCommands::~TaskSketcherCreateCommands(), Gui::TaskView::TaskView::~TaskView(), Gui::View3DInventorViewer::~View3DInventorViewer(), InspectionGui::ViewProviderInspection::~ViewProviderInspection(), and MeshGui::ViewProviderMeshCurvature::~ViewProviderMeshCurvature().
Observer<_MessageType>* Base::Subject< _MessageType >::Get | ( | const char * | Name | ) | [inline] |
Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode.
Definition at line 180 of file Observer.h.
void Base::Subject< _MessageType >::Notify | ( | _MessageType | rcReason | ) | [inline] |
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.
Definition at line 170 of file Observer.h.
Referenced by InspectionGui::ViewProviderInspection::attach(), MeshGui::ViewProviderMeshCurvature::attach(), InspectionGui::ViewProviderInspection::onChanged(), and InspectionGui::ViewProviderInspection::updateData().
std::set<Observer <_MessageType> *> Base::Subject< _MessageType >::_ObserverSet [protected] |
Vector of attached observers.
Definition at line 204 of file Observer.h.
Referenced by Base::Subject< const char * >::Attach(), Base::Subject< const char * >::ClearObserver(), Base::Subject< const char * >::Detach(), Base::Subject< const char * >::Get(), Base::Subject< const char * >::Notify(), and Base::Subject< const char * >::~Subject().