NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSubject< T > Class Template Reference

#include <tgSubject.h>

Public Member Functions

 tgSubject ()
 
virtual ~tgSubject ()
 
void attach (tgObserver< T > *pObserver)
 
void notifyStep (double dt)
 
void notifySetup ()
 
void notifyTeardown ()
 

Detailed Description

template<typename T>
class tgSubject< T >

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.

Constructor & Destructor Documentation

template<typename T>
tgSubject< T >::tgSubject ( )
inline

The consructor has nothing to do.

Definition at line 49 of file tgSubject.h.

template<typename T>
virtual tgSubject< T >::~tgSubject ( )
inlinevirtual

The virtual destructor has nothing to do.

Definition at line 52 of file tgSubject.h.

Member Function Documentation

template<typename Subject>
void tgSubject< Subject >::attach ( tgObserver< Subject > *  pObserver)

Attach an observer to the subject of the observer.

Parameters
[in,out]pObservera pointer to an observer for the subject; do nothing if the pointer is NULL

Definition at line 91 of file tgSubject.h.

Here is the call graph for this function:

template<typename Subject >
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.

Here is the call graph for this function:

template<typename Subject >
void tgSubject< Subject >::notifyStep ( double  dt)

Call tgObserver<T>::onStep() on all observers in the order in which they were attached.

Parameters
[in]dtthe number of seconds since the previous call; do nothing if not positive

Definition at line 98 of file tgSubject.h.

Here is the call graph for this function:

template<typename Subject >
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.

Here is the call graph for this function:


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