NTRT Simulator
v1.1
|
#include <tgSubject.h>
Public Member Functions | |
tgSubject () | |
virtual | ~tgSubject () |
void | attach (tgObserver< T > *pObserver) |
void | notifyStep (double dt) |
void | notifySetup () |
void | notifyTeardown () |
A mixin base class for the subject in the observer design pattern. Observers are attached to the subject, and their onStep() member functions are called when notification is required. Used primarily for control of tensegrity structures, a structure that needs to be controlled will be a child of this class. This can either be the main model or submodels such as a tgLinearString
Definition at line 44 of file tgSubject.h.
The consructor has nothing to do.
Definition at line 49 of file tgSubject.h.
The virtual destructor has nothing to do.
Definition at line 52 of file tgSubject.h.
void tgSubject< Subject >::attach | ( | tgObserver< Subject > * | pObserver | ) |
Attach an observer to the subject of the observer.
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
Definition at line 91 of file tgSubject.h.
void tgSubject< Subject >::notifySetup | ( | ) |
Call tgObserver<T>::onSetup() on all observers in the order in which they were attached.
Definition at line 112 of file tgSubject.h.
void tgSubject< Subject >::notifyStep | ( | double | dt | ) |
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
Definition at line 98 of file tgSubject.h.
void tgSubject< Subject >::notifyTeardown | ( | ) |
Call tgObserver<T>::onTeardown() on all observers in the order in which they were attached.
Definition at line 123 of file tgSubject.h.