YANE-Framework 1.1.0
Public Member Functions | Protected Attributes

yane::NetworkedControl::Cycle Class Reference

Class for handling discrete and continuous time sampling instances and times.

Inheritance diagram for yane::NetworkedControl::Cycle:
[legend]
Collaboration diagram for yane::NetworkedControl::Cycle:
[legend]

List of all members.

Public Member Functions

 Cycle (double discr_time)
 Constructor.
double cycleElapsedSeconds ()
 Function to return the elapsed time since start of the current sampling cycle.
double cycleEndSeconds ()
 Function to return the terminal time of the current sampling cycle.
double cycleRemainingSeconds ()
 Function to return the remaining time within the current sampling cycle.
double cycleStartSeconds ()
 Function to return the initial time of the current sampling cycle.
double discrTime () const
 Function to return the sampling width.
double elapsedSeconds ()
 Function to evaluate the passed time since start of the timer.
unsigned int get ()
 Function to return the current sampling cycle number.
void getStartTime (timeval *time)
 Function to pass the initial time of the timer to external routines.
void reset (const timeval &starttime)
 Function to reset the timer to a new initial time.
void reset ()
 Function to reset the timer.
void setElapsedSeconds (double seconds)
 Sets the elapsed seconds of this object to a specific value.
void waitUntil (double time)
 Function to block the calling thread up to the given target time.
virtual ~Cycle ()
 Destructor.

Protected Attributes

double _discr_time
 Sampling width.
timeval _starttime
 Initial time for timer.

Constructor & Destructor Documentation

LIB_EXPORT yane::NetworkedControl::Cycle::Cycle ( double  discr_time)

Constructor
This function sets up and start a clock used for sampling.

Parameters:
discr_timeSampling width

Member Function Documentation

LIB_EXPORT double yane::NetworkedControl::Cycle::cycleElapsedSeconds ( )

Function to return the elapsed time since start of the current sampling cycle

Returns:
Elapsed time since start of the current sampling cycle in seconds
LIB_EXPORT double yane::NetworkedControl::Cycle::cycleEndSeconds ( )

Function to return the terminal time of the current sampling cycle

Returns:
Terminal time of the current sampling cycle in seconds
LIB_EXPORT double yane::NetworkedControl::Cycle::cycleRemainingSeconds ( )

Function to return the remaining time within the current sampling cycle

Returns:
Remaining time within the current sampling cycle in seconds
LIB_EXPORT double yane::NetworkedControl::Cycle::cycleStartSeconds ( )

Function to return the initial time of the current sampling cycle

Returns:
Initial time of the current sampling cycle in seconds
LIB_EXPORT double yane::NetworkedControl::Cycle::discrTime ( ) const

Function to return the sampling width

Returns:
Sampling width in seconds
LIB_EXPORT unsigned int yane::NetworkedControl::Cycle::get ( )

Function to return the current sampling cycle number

Returns:
Current cycling number
LIB_EXPORT void yane::Utils::RTClock::getStartTime ( timeval *  time) [inherited]
Parameters:
timeInitial time of the timer
LIB_EXPORT void yane::Utils::RTClock::reset ( const timeval &  starttime) [inherited]
Parameters:
starttimeInitial time for timer
LIB_EXPORT void yane::Utils::RTClock::setElapsedSeconds ( double  seconds) [inherited]
Parameters:
secondsNew value for elapsed seconds
See also:
elapsedSeconds()
LIB_EXPORT void yane::NetworkedControl::Cycle::waitUntil ( double  time)

Function to block the calling thread up to the given target time

Parameters:
timeTarget time in seconds