DART
6.10.1
|
The Observer class should be inherited by any class that wants to respond in a customized way to the destruction of a Subject. More...
#include <Observer.hpp>
Public Member Functions | |
virtual | ~Observer () |
Destructor will notify all Subjects that it is destructing. More... | |
Protected Member Functions | |
void | receiveDestructionNotification (const Subject *_subject) |
Called whenever a Subject is destroyed (or sends out a destruction notification). More... | |
virtual void | handleDestructionNotification (const Subject *_subject) |
Called by receiveDestructionNotification(). More... | |
void | addSubject (const Subject *_subject) |
Add a Subject for this Observer. More... | |
void | removeSubject (const Subject *_subject) |
Remove a Subject from this Observer. More... | |
void | removeAllSubjects () |
Remove all Subjects from this Observer. More... | |
Protected Attributes | |
std::set< const Subject * > | mSubjects |
List of current Subjects for this Observer. More... | |
Friends | |
class | Subject |
The Observer class should be inherited by any class that wants to respond in a customized way to the destruction of a Subject.
Simply override the Observer::handleDestructionNotification() function to customize how your class responds to the destruction of a Subject.
dart::sub_ptr is a templated smart pointer that will change itself into a nullptr when its Subject is destroyed. It offers one of the easiest ways to take advantage of the Subject/Observer pattern.
|
virtual |
Destructor will notify all Subjects that it is destructing.
|
protected |
|
protectedvirtual |
Called by receiveDestructionNotification().
Override this function to customize your class's response to destruction notifications.
Reimplemented in dart::common::sub_ptr< T >, dart::common::sub_ptr< dart::dynamics::InverseKinematics >, dart::common::sub_ptr< dart::dynamics::JacobianNode >, dart::common::sub_ptr< dart::gui::osg::InteractiveTool >, dart::gui::osg::SimpleFrameShapeDnD, dart::gui::osg::DragAndDrop, dart::gui::osg::DefaultEventHandler, and dart::collision::CollisionGroup::ShapeFrameObserver.
|
protected |
Called whenever a Subject is destroyed (or sends out a destruction notification).
Override handleDestructionNotification() in order to customize your class's response to destruction notifications.
|
protected |
Remove all Subjects from this Observer.
|
protected |
|
friend |