Marsyas  0.5.0-beta1
Public Member Functions
TmVirtualTime Class Reference

TmVirtualTime reads the insamples information to advance the timer. More...

#include <TmVirtualTime.h>

Inherits TmTimer.

Public Member Functions

mrs_natural intervalsize (std::string interval)
 convert the given interval into a number of samples.
mrs_natural readTimeSrc ()
 get the difference between the current source control value and its value since it was last read.
void setSource (MarSystem *ms)
 set the MarSystem that contains the read control.
 TmVirtualTime ()
 empty constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...) Given the default name: Virtual as in "TmSampleTime/Virtual"
 TmVirtualTime (std::string name)
 named constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...). Given the default name: "TmSampleTime/name"
 TmVirtualTime (std::string name, MarSystem *ms)
 main constructor. Has identifier "TmSampleCount/Virtual"
 TmVirtualTime (const TmVirtualTime &s)
 copy constructor
virtual void updtimer (std::string cname, TmControlValue value)
 update timer values.
virtual ~TmVirtualTime ()

Detailed Description

TmVirtualTime reads the insamples information to advance the timer.

Author:
Neil Burroughs inb@cs.uvic.ca

Definition at line 39 of file TmVirtualTime.h.


Constructor & Destructor Documentation

empty constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...) Given the default name: Virtual as in "TmSampleTime/Virtual"

Definition at line 26 of file TmVirtualTime.cpp.

TmVirtualTime ( std::string  name)

named constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...). Given the default name: "TmSampleTime/name"

Parameters:
namea unique name to call this timer

Definition at line 31 of file TmVirtualTime.cpp.

TmVirtualTime ( std::string  name,
MarSystem ms 
)

main constructor. Has identifier "TmSampleCount/Virtual"

Parameters:
msthe MarSystem that contains the control to read
namethe control name to read

Definition at line 36 of file TmVirtualTime.cpp.

TmVirtualTime ( const TmVirtualTime s)

copy constructor

Parameters:
stimer to copy

Definition at line 41 of file TmVirtualTime.cpp.

~TmVirtualTime ( ) [virtual]

Definition at line 46 of file TmVirtualTime.cpp.


Member Function Documentation

mrs_natural intervalsize ( std::string  interval) [virtual]

convert the given interval into a number of samples.

The interval must fall within sample time which can include standard time units: us, ms, s, m, h, d. The sample rate used for this function is the value of the mrs_real/israte control of the source MarSystem.

Parameters:
intervalthe interval to calculate
Returns:
the number of samples contained in the interval

Implements TmTimer.

Definition at line 83 of file TmVirtualTime.cpp.

mrs_natural readTimeSrc ( ) [virtual]

get the difference between the current source control value and its value since it was last read.

Returns:
the count since last read

Implements TmTimer.

Definition at line 62 of file TmVirtualTime.cpp.

void setSource ( MarSystem ms)

set the MarSystem that contains the read control.

This method sets the read source to the parameter without checking. It then attempts to get the MarControlPtr for the control unless the read source is NULL or the read ctrl path is "". No warnings are produced.

Parameters:
msread source MarSystem

Definition at line 49 of file TmVirtualTime.cpp.

void updtimer ( std::string  cname,
TmControlValue  value 
) [virtual]

update timer values.

Allowable control values for this timer are: MarSystem/source, and mrs_string/control.

Parameters:
cnamethe control name of a timer value
valuethe value to update the control with

Reimplemented from TmTimer.

Definition at line 91 of file TmVirtualTime.cpp.


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