Thrill
0.1
|
TimedCounter counts the number of Trigger() invokes. The time points of these invocations are stored.
Definition at line 24 of file timed_counter.hpp.
#include <timed_counter.hpp>
Public Types | |
using | TimePoint = std::chrono::high_resolution_clock::time_point |
Public Member Functions | |
TimedCounter (const TimedCounter &that)=delete | |
TimedCounter (TimedCounter &&rhs) | |
TimedCounter () | |
size_t | Count () const |
Returns the number of Occurences on this timer. More... | |
std::vector< TimePoint > | Occurences () const |
Returns the Occurences of this timer. More... | |
TimedCounter | operator+ (const TimedCounter &rhs) |
Adds occurences of two instances and sorts them ascending. More... | |
TimedCounter & | operator+= (const TimedCounter &rhs) |
void | Reset () |
Drops all Occurences of this timer. More... | |
void | Trigger () |
Registers a new Occurence on this TimedCounter. More... | |
Private Member Functions | |
TimePoint | timestamp () |
Private Attributes | |
std::vector< TimePoint > | occurences_ |
using TimePoint = std::chrono::high_resolution_clock::time_point |
Definition at line 27 of file timed_counter.hpp.
|
delete |
|
inline |
Definition at line 32 of file timed_counter.hpp.
References TimedCounter::occurences_.
|
inline |
Definition at line 36 of file timed_counter.hpp.
|
inline |
Returns the number of Occurences on this timer.
Definition at line 66 of file timed_counter.hpp.
References TimedCounter::occurences_.
|
inline |
Returns the Occurences of this timer.
Definition at line 71 of file timed_counter.hpp.
References TimedCounter::occurences_.
Referenced by TimedCounter::operator+=().
|
inline |
Adds occurences of two instances and sorts them ascending.
Definition at line 48 of file timed_counter.hpp.
|
inline |
Adds the occurences of another TimedCounter to this instance. Occurences will be sorted to be ascending
Definition at line 40 of file timed_counter.hpp.
References TimedCounter::Occurences(), and TimedCounter::occurences_.
|
inline |
Drops all Occurences of this timer.
Definition at line 61 of file timed_counter.hpp.
References TimedCounter::occurences_.
|
inlineprivate |
Definition at line 76 of file timed_counter.hpp.
Referenced by TimedCounter::Trigger().
|
inline |
Registers a new Occurence on this TimedCounter.
Definition at line 56 of file timed_counter.hpp.
References TimedCounter::occurences_, and TimedCounter::timestamp().
|
private |
Definition at line 80 of file timed_counter.hpp.
Referenced by TimedCounter::Count(), TimedCounter::Occurences(), TimedCounter::operator+=(), TimedCounter::Reset(), TimedCounter::TimedCounter(), and TimedCounter::Trigger().