NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgObserver< Subject > Class Template Referenceabstract

#include <tgObserver.h>

Public Member Functions

virtual ~tgObserver ()
 
virtual void onStep (Subject &subject, double dt)=0
 
virtual void onAttach (Subject &subject)
 
virtual void onSetup (Subject &subject)
 
virtual void onTeardown (Subject &subject)
 

Detailed Description

template<class Subject>
class tgObserver< Subject >

A mixin class which makes its derived class the Subject in the Obsever design pattern. These are typically controllers.

Definition at line 35 of file tgObserver.h.

Constructor & Destructor Documentation

template<class Subject>
virtual tgObserver< Subject >::~tgObserver ( )
inlinevirtual

A class with virtual member functions must have a virtual destructor.

Definition at line 40 of file tgObserver.h.

Member Function Documentation

template<class Subject>
virtual void tgObserver< Subject >::onAttach ( Subject &  subject)
inlinevirtual

Notify the observers when an attach action has occurred. Will only occur once, typically before setup

Parameters
[in,out]subjectthe subject being observed

Reimplemented in tgCPGMGActuatorControl, tgCPGActuatorControl, and tgSCASineControl.

Definition at line 55 of file tgObserver.h.

Here is the caller graph for this function:

template<class Subject>
virtual void tgObserver< Subject >::onSetup ( Subject &  subject)
inlinevirtual
template<class Subject>
virtual void tgObserver< Subject >::onStep ( Subject &  subject,
double  dt 
)
pure virtual

Notify the observers when a step action has occurred.

Parameters
[in,out]subjectthe subject being observed
[in]thenumber of seconds since the previous call; must be positive

Implemented in SerializedSpineControl, SerializedSineWaves, JSONAchillesHierarchyControl, JSONAOHierarchyControl, JSONHierarchyFeedbackControl, JSONMGCPGGeneralControl, BaseSpineCPGControl, JSONQuadCPGControl, JSONCPGControl, JSONSegmentsFeedbackControl, JSONGoalControl, JSONQuadFeedbackControl, JSONMGFeedbackControl, SpineGoalControl, JSONStatsFeedbackControl, JSONMetricsFeedbackControl, JSONMGFeedbackControlFM0, JSONMGFeedbackControlFM1, JSONMixedLearningControl, JSONQuadFeedbackControl, JSONQuadFeedbackControl, SpineOnlineControl, JSONFeedbackControl, SpineFeedbackControl, NestedStructureSineWaves, SpineKinematicsTestController, VerticalSpineBendingController, TensegrityModelController, T6RestLengthController, T6RestLengthController, VerticalSpineRestLengthController, VerticalSpineRestLengthController, RPLengthController, RPLengthController, RPLengthController, VerticalSpinePassiveController, T6TensionController, SuperBallPrefLengthController, ScarrArmController, SuperBallPrefLengthController, OctahedralGoalControl, OctahedralTensionControl, JSONGoalTensionNNW, JSONGoalTension, tgCPGMGActuatorControl, Escape_T6Controller, EscapeController, tgCPGActuatorControl, Escape_T6Controller, tgCPGJSONLogger, OctaCLSine, LearningSpineSine, tgCPGLogger, htSpineSine, colSpineSine, BigPuppyController, tgSCASineControl, tgSineStringControl, tgCPGMGCableControl, tgCPGCableControl, ContactTestController, tgCPGStringControl_mod, and BuildTestController.

Here is the caller graph for this function:


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