DP3
Public Member Functions | List of all members
dp3::common::ScopedMicroSecondAccumulator< T, Clock > Class Template Reference

#include <Timer.h>

Public Member Functions

 ScopedMicroSecondAccumulator (const ScopedMicroSecondAccumulator &)=delete
 
 ScopedMicroSecondAccumulator (T &accumulator)
 
 ~ScopedMicroSecondAccumulator ()
 

Detailed Description

template<class T, class Clock = std::chrono::steady_clock>
class dp3::common::ScopedMicroSecondAccumulator< T, Clock >

Helper class to accumulate the execution time of multiple timers.

Objects of this class measure duration of their life-time and add that time to accumulator. The class is intended to be used in scope based fashion, thus it's neither copyable nor movable.

It's intended the class can be used to accumulate one timer from multiple threads, so it should be able to use a std::atomic<T>. Unfortunately std::atomic<T> for floating-point types requires C++20.

The resolution of the class is based on the µs resolution of the NSTimer class.

Constructor & Destructor Documentation

◆ ScopedMicroSecondAccumulator() [1/2]

template<class T , class Clock = std::chrono::steady_clock>
dp3::common::ScopedMicroSecondAccumulator< T, Clock >::ScopedMicroSecondAccumulator ( T &  accumulator)
inlineexplicit

◆ ScopedMicroSecondAccumulator() [2/2]

template<class T , class Clock = std::chrono::steady_clock>
dp3::common::ScopedMicroSecondAccumulator< T, Clock >::ScopedMicroSecondAccumulator ( const ScopedMicroSecondAccumulator< T, Clock > &  )
delete

◆ ~ScopedMicroSecondAccumulator()

template<class T , class Clock = std::chrono::steady_clock>
dp3::common::ScopedMicroSecondAccumulator< T, Clock >::~ScopedMicroSecondAccumulator ( )
inline

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