#include <abstractTimer.hpp>
|
| | AbstractTimer (QTime ifirstCalled) |
| | A Timer base class which implements its methods in terms of millis().
|
| |
| virtual | ~AbstractTimer () |
| |
| virtual QTime | millis () const =0 |
| | Returns the current time in units of QTime.
|
| |
| virtual QTime | getDt () |
| | Returns the time passed in ms since the previous call of this function.
|
| |
| virtual QTime | readDt () const |
| | Returns the time passed in ms since the previous call of getDt().
|
| |
| virtual QTime | getStartingTime () const |
| | Returns the time the timer was first constructed.
|
| |
| virtual QTime | getDtFromStart () const |
| | Returns the time since the timer was first constructed.
|
| |
| virtual void | placeMark () |
| | Place a time marker.
|
| |
| virtual QTime | clearMark () |
| | Clears the marker.
|
| |
| virtual void | placeHardMark () |
| | Place a hard time marker.
|
| |
| virtual QTime | clearHardMark () |
| | Clears the hard marker.
|
| |
| virtual QTime | getDtFromMark () const |
| | Returns the time since the time marker.
|
| |
| virtual QTime | getDtFromHardMark () const |
| | Returns the time since the hard time marker.
|
| |
| virtual bool | repeat (QTime time) |
| | Returns true when the input time period has passed, then resets.
|
| |
| virtual bool | repeat (QFrequency frequency) |
| | Returns true when the input time period has passed, then resets.
|
| |
Definition at line 12 of file abstractTimer.hpp.
◆ AbstractTimer()
| okapi::AbstractTimer::AbstractTimer |
( |
QTime |
ifirstCalled | ) |
|
|
explicit |
A Timer base class which implements its methods in terms of millis().
- Parameters
-
| ifirstCalled | the current time |
◆ ~AbstractTimer()
| virtual okapi::AbstractTimer::~AbstractTimer |
( |
| ) |
|
|
virtual |
◆ clearHardMark()
| virtual QTime okapi::AbstractTimer::clearHardMark |
( |
| ) |
|
|
virtual |
Clears the hard marker.
- Returns
- The old hard marker
◆ clearMark()
| virtual QTime okapi::AbstractTimer::clearMark |
( |
| ) |
|
|
virtual |
Clears the marker.
- Returns
- The old marker
◆ getDt()
| virtual QTime okapi::AbstractTimer::getDt |
( |
| ) |
|
|
virtual |
Returns the time passed in ms since the previous call of this function.
- Returns
- The time passed in ms since the previous call of this function
◆ getDtFromHardMark()
| virtual QTime okapi::AbstractTimer::getDtFromHardMark |
( |
| ) |
const |
|
virtual |
Returns the time since the hard time marker.
Returns 0_ms if there is no hard marker set.
- Returns
- The time since the hard time marker
◆ getDtFromMark()
| virtual QTime okapi::AbstractTimer::getDtFromMark |
( |
| ) |
const |
|
virtual |
Returns the time since the time marker.
Returns 0_ms if there is no marker.
- Returns
- The time since the time marker
◆ getDtFromStart()
| virtual QTime okapi::AbstractTimer::getDtFromStart |
( |
| ) |
const |
|
virtual |
Returns the time since the timer was first constructed.
- Returns
- The time since the timer was first constructed
◆ getStartingTime()
| virtual QTime okapi::AbstractTimer::getStartingTime |
( |
| ) |
const |
|
virtual |
Returns the time the timer was first constructed.
- Returns
- The time the timer was first constructed
◆ millis()
| virtual QTime okapi::AbstractTimer::millis |
( |
| ) |
const |
|
pure virtual |
Returns the current time in units of QTime.
- Returns
- the current time
Implemented in okapi::Timer.
◆ placeHardMark()
| virtual void okapi::AbstractTimer::placeHardMark |
( |
| ) |
|
|
virtual |
Place a hard time marker.
Placing another hard marker will not overwrite the previous one; instead, call clearHardMark() and then place another.
◆ placeMark()
| virtual void okapi::AbstractTimer::placeMark |
( |
| ) |
|
|
virtual |
Place a time marker.
Placing another marker will overwrite the previous one.
◆ readDt()
| virtual QTime okapi::AbstractTimer::readDt |
( |
| ) |
const |
|
virtual |
Returns the time passed in ms since the previous call of getDt().
Does not change the time recorded by getDt().
- Returns
- The time passed in ms since the previous call of getDt()
◆ repeat() [1/2]
| virtual bool okapi::AbstractTimer::repeat |
( |
QFrequency |
frequency | ) |
|
|
virtual |
Returns true when the input time period has passed, then resets.
Meant to be used in loops to run an action every time period without blocking.
- Parameters
-
| frequency | the repeat frequency |
- Returns
- true when the input time period has passed, false after reading true until the period has passed again
◆ repeat() [2/2]
| virtual bool okapi::AbstractTimer::repeat |
( |
QTime |
time | ) |
|
|
virtual |
Returns true when the input time period has passed, then resets.
Meant to be used in loops to run an action every time period without blocking.
- Parameters
-
- Returns
- true when the input time period has passed, false after reading true until the period has passed again
◆ firstCalled
| QTime okapi::AbstractTimer::firstCalled |
|
protected |
◆ hardMark
| QTime okapi::AbstractTimer::hardMark |
|
protected |
◆ lastCalled
| QTime okapi::AbstractTimer::lastCalled |
|
protected |
◆ mark
| QTime okapi::AbstractTimer::mark |
|
protected |
◆ repeatMark
| QTime okapi::AbstractTimer::repeatMark |
|
protected |
The documentation for this class was generated from the following file: