SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
#include <CSystemClock.hpp>
Static Public Member Functions | |
static bool | start () |
static suClock | getSysTime () |
static suClock | getSimTime () |
static void | tick (suClock arg_dt) |
static void | progressToTime (const timeval &arg_t_start, const suClock arg_time_increment=1.0, const bool arg_increment_sim_clock=true) |
Private Member Functions | |
CSystemClock () | |
CSystemClock (const CSystemClock &) | |
CSystemClock & | operator= (const CSystemClock &) |
Static Private Member Functions | |
static suClock | computeTDiff (const timeval &arg_t_start) |
static SSystemClock * | getData () |
static bool | resetData () |
Private Attributes | |
SSystemClock | data_ |
Static Private Attributes | |
static CSingleton * | singleton_ |
A system (global) clock to measure time in seconds.
Since it uses the singleton to ensure global time syncing, a "startClock" function must be called to initialize the time to zero.
NOTE : This class does not do any error checks while returning the time. Make sure that start() returns true.
|
private |
Private for the singleton
|
private |
Private for the singleton
|
inlinestaticprivate |
Computes the elapsed time (in seconds) since the passed timeval
|
staticinherited |
Creates a singleton if necessary and returns it.
Returns a pointer instead of a reference to support a 0 return when there is an error
|
inlinestatic |
Returns the current simulation time. Increment this by calling the tick() function
|
inlinestatic |
Returns the system time (in seconds) since the clock was initialized.
|
private |
Private for the singleton
|
inlinestatic |
Progresses the simulation time (sleeps if there is nothing to do).
Works approximately.
|
staticinherited |
Deletes the singleton instance and creates a new one.
|
inlinestatic |
Forces the singleton to create the object (and hence set the start time through the constructor).
|
protectedinherited |
Shared Memory: The publicly available data that will be shared across the different subsystems
|
staticprotectedinherited |
The singleton instance
This initializes the pointer to null