SampleAndHold_< T > Class Template Reference

This is a Measure operator which, upon occurrence of a designated event, samples its source Measure and then holds its value in a discrete state variable until the next occurrence of the event. More...

#include <Measure.h>

Inheritance diagram for SampleAndHold_< T >:
Measure_< T > Measure

List of all members.

Public Member Functions

 SimTK_MEASURE_HANDLE_PREAMBLE (SampleAndHold_, Measure_< T >)
 SampleAndHold_ (Subsystem &sub, const Measure_< T > &source, EventIndex e)
void setValue (State &s, const T &value) const
 Set the held value to a particular value, unrelated to the source.
void sample (State &s) const
 Force this Measure to sample its input at the current time.
const Measure_< T > & getSource () const
EventIndex getEvent () const
SampleAndHold_setSource (const Measure_< T > &s)
SampleAndHold_setEvent (EventIndex)
 SimTK_MEASURE_HANDLE_POSTSCRIPT (SampleAndHold_, Measure_< T >)

Detailed Description

template<class T>
class SimTK::Measure::SampleAndHold_< T >

This is a Measure operator which, upon occurrence of a designated event, samples its source Measure and then holds its value in a discrete state variable until the next occurrence of the event.

Any type of data can be sampled this way.

Information available from this Measure:

Study initialization is always considered a sampling event. This measure has no time derivative.


Constructor & Destructor Documentation

SampleAndHold_ ( Subsystem sub,
const Measure_< T > &  source,
EventIndex  e 
)

Member Function Documentation

EventIndex getEvent (  )  const
const Measure_<T>& getSource (  )  const
void sample ( State s  )  const

Force this Measure to sample its input at the current time.

SampleAndHold_& setEvent ( EventIndex   ) 
SampleAndHold_& setSource ( const Measure_< T > &  s  ) 
void setValue ( State s,
const T &  value 
) const

Set the held value to a particular value, unrelated to the source.

The time stamp will be taken from the supplied State.

SimTK_MEASURE_HANDLE_POSTSCRIPT ( SampleAndHold_< T >  ,
Measure_< T >   
)
SimTK_MEASURE_HANDLE_PREAMBLE ( SampleAndHold_< T >  ,
Measure_< T >   
)

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

Generated by  doxygen 1.6.2