Gobelijn API documentation
- generated for commit a0cbea7
|
Provides a stopwatch interface to time: it accumulates time between start/stop pairs. More...
#include <Stopwatch.h>
Public Types | |
typedef T | TClock |
Public Member Functions | |
Stopwatch (std::string name="stopwatch", bool running=false) | |
Constructor initializes stopwatch. More... | |
Stopwatch & | Start () |
Starts stopwatch if it was stopped. More... | |
Stopwatch & | Stop () |
Stops the stopwatch if it was running. More... | |
Stopwatch & | Reset () |
Resets stopwatch i.e. More... | |
bool | IsRunning () const |
Reports whether stopwatch has been started. More... | |
std::string | GetName () const |
Return name of this stopwatch. More... | |
T::duration | Get () const |
Returns the accumulated value without altering the stopwatch state. More... | |
std::string | ToString () const |
Returns string representation of readout. More... | |
Private Attributes | |
T::duration | m_accumulated |
T::time_point | m_last_start |
std::string | m_name |
bool | m_running |
Provides a stopwatch interface to time: it accumulates time between start/stop pairs.
Definition at line 33 of file Stopwatch.h.
typedef T UA_CoMP::Timekeeper::Stopwatch< T >::TClock |
Definition at line 36 of file Stopwatch.h.
|
inline |
Constructor initializes stopwatch.
Definition at line 39 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_last_start, and UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
|
inline |
Starts stopwatch if it was stopped.
Definition at line 48 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_last_start, and UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
|
inline |
Stops the stopwatch if it was running.
Definition at line 58 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_accumulated, UA_CoMP::Timekeeper::Stopwatch< T >::m_last_start, and UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
|
inline |
Resets stopwatch i.e.
stopwatch is stopped and time accumulator is cleared.
Definition at line 69 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_accumulated, and UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
|
inline |
Reports whether stopwatch has been started.
Definition at line 77 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
|
inline |
Return name of this stopwatch.
Definition at line 80 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_name.
|
inline |
Returns the accumulated value without altering the stopwatch state.
Definition at line 83 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::m_accumulated, UA_CoMP::Timekeeper::Stopwatch< T >::m_last_start, and UA_CoMP::Timekeeper::Stopwatch< T >::m_running.
Referenced by UA_CoMP::Timekeeper::Stopwatch< T >::ToString().
|
inline |
Returns string representation of readout.
Definition at line 93 of file Stopwatch.h.
References UA_CoMP::Timekeeper::Stopwatch< T >::Get(), and UA_CoMP::Timekeeper::Utils::ToColonString().
|
private |
Definition at line 114 of file Stopwatch.h.
Referenced by UA_CoMP::Timekeeper::Stopwatch< T >::Get(), UA_CoMP::Timekeeper::Stopwatch< T >::Reset(), and UA_CoMP::Timekeeper::Stopwatch< T >::Stop().
|
private |
Definition at line 115 of file Stopwatch.h.
Referenced by UA_CoMP::Timekeeper::Stopwatch< T >::Get(), UA_CoMP::Timekeeper::Stopwatch< T >::Start(), UA_CoMP::Timekeeper::Stopwatch< T >::Stop(), and UA_CoMP::Timekeeper::Stopwatch< T >::Stopwatch().
|
private |
Definition at line 116 of file Stopwatch.h.
Referenced by UA_CoMP::Timekeeper::Stopwatch< T >::GetName().
|
private |
Definition at line 117 of file Stopwatch.h.
Referenced by UA_CoMP::Timekeeper::Stopwatch< T >::Get(), UA_CoMP::Timekeeper::Stopwatch< T >::IsRunning(), UA_CoMP::Timekeeper::Stopwatch< T >::Reset(), UA_CoMP::Timekeeper::Stopwatch< T >::Start(), UA_CoMP::Timekeeper::Stopwatch< T >::Stop(), and UA_CoMP::Timekeeper::Stopwatch< T >::Stopwatch().