Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TimedCounter Class Reference

Detailed Description

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< TimePointOccurences () const
 Returns the Occurences of this timer. More...
 
TimedCounter operator+ (const TimedCounter &rhs)
 Adds occurences of two instances and sorts them ascending. More...
 
TimedCounteroperator+= (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< TimePointoccurences_
 

Member Typedef Documentation

using TimePoint = std::chrono::high_resolution_clock::time_point

Definition at line 27 of file timed_counter.hpp.

Constructor & Destructor Documentation

TimedCounter ( const TimedCounter that)
delete
TimedCounter ( TimedCounter &&  rhs)
inline

Definition at line 32 of file timed_counter.hpp.

References TimedCounter::occurences_.

TimedCounter ( )
inline

Definition at line 36 of file timed_counter.hpp.

Member Function Documentation

size_t Count ( ) const
inline

Returns the number of Occurences on this timer.

Definition at line 66 of file timed_counter.hpp.

References TimedCounter::occurences_.

std::vector<TimePoint> Occurences ( ) const
inline

Returns the Occurences of this timer.

Definition at line 71 of file timed_counter.hpp.

References TimedCounter::occurences_.

Referenced by TimedCounter::operator+=().

TimedCounter operator+ ( const TimedCounter rhs)
inline

Adds occurences of two instances and sorts them ascending.

Definition at line 48 of file timed_counter.hpp.

TimedCounter& operator+= ( const TimedCounter rhs)
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_.

void Reset ( )
inline

Drops all Occurences of this timer.

Definition at line 61 of file timed_counter.hpp.

References TimedCounter::occurences_.

TimePoint timestamp ( )
inlineprivate

Definition at line 76 of file timed_counter.hpp.

Referenced by TimedCounter::Trigger().

void Trigger ( )
inline

Registers a new Occurence on this TimedCounter.

Definition at line 56 of file timed_counter.hpp.

References TimedCounter::occurences_, and TimedCounter::timestamp().

Member Data Documentation


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