gusimplewhiteboard
guWhiteboard::Clocks Class Reference

Class for working with timing and clock messages. More...

#include <Clocks.hpp>

Inheritance diagram for guWhiteboard::Clocks:
Collaboration diagram for guWhiteboard::Clocks:

Public Member Functions

int64_t get (uint8_t clock_id) const
 clock counter getter More...
 
void set (int clock_id, int64_t value)
 clock counter setter More...
 
void reset (int clock_id)
 reset a clock counter to the current time More...
 
int64_t time (int clock_id)
 get the current time since last reset of a given clock More...
 
int64_t time_ms (int clock_id)
 time since last reset in ms More...
 
 Clocks (const std::string &state)
 string constructor More...
 
std::string description () const
 convert to a string More...
 
void from_string (const std::string &str)
 convert from a string More...
 
- Public Member Functions inherited from wb_clocks
 ARRAY_PROPERTY (wb_clocks_t, clocks, sizeof(gu_simple_message)/sizeof(wb_clocks_t)) wb_clocks()
 array of clock counters More...
 

Detailed Description

Class for working with timing and clock messages.

Examples

reset timer 3 to the current time Clocks c = Clocks_t.get(); c.reset(3);

get the time since the last reset of clock 3 Clocks c = Clock_t.get(); long long t = c.timeSince(3);

Definition at line 86 of file Clocks.hpp.

Constructor & Destructor Documentation

◆ Clocks()

guWhiteboard::Clocks::Clocks ( const std::string &  state)
inline

string constructor

Definition at line 108 of file Clocks.hpp.

References from_string().

Member Function Documentation

◆ description()

std::string guWhiteboard::Clocks::description ( ) const
inline

convert to a string

Definition at line 111 of file Clocks.hpp.

References CLOCKS_SIZE.

◆ from_string()

void guWhiteboard::Clocks::from_string ( const std::string &  str)
inline

convert from a string

Definition at line 125 of file Clocks.hpp.

References VALID_KEYVALUE.

Referenced by Clocks().

◆ get()

int64_t guWhiteboard::Clocks::get ( uint8_t  clock_id) const
inline

clock counter getter

Definition at line 90 of file Clocks.hpp.

References CLOCKS_SIZE.

◆ reset()

void guWhiteboard::Clocks::reset ( int  clock_id)
inline

reset a clock counter to the current time

Definition at line 98 of file Clocks.hpp.

◆ set()

void guWhiteboard::Clocks::set ( int  clock_id,
int64_t  value 
)
inline

clock counter setter

Definition at line 95 of file Clocks.hpp.

◆ time()

int64_t guWhiteboard::Clocks::time ( int  clock_id)
inline

get the current time since last reset of a given clock

Definition at line 101 of file Clocks.hpp.

◆ time_ms()

int64_t guWhiteboard::Clocks::time_ms ( int  clock_id)
inline

time since last reset in ms

Definition at line 104 of file Clocks.hpp.


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