15#include <boost/serialization/access.hpp>
26 template<
class ECounterKey,
class ETimerKey>
68 int GetNofTimers()
const {
return static_cast<int>(ETimerKey::END); }
95 template<
typename Archive>
113 template<
class ECounterKey,
class ETimerKey>
117 for (
size_t iCounter = 0; iCounter < faCounters.size(); ++iCounter) {
118 faCounters[iCounter] += other.faCounters[iCounter];
120 for (
size_t iTimer = 0; iTimer < faTimers.size(); ++iTimer) {
121 faTimers[iTimer].AddTimer(other.faTimers[iTimer], parallel);
127 template<
class ECounterKey,
class ETimerKey>
131 std::for_each(faTimers.begin(), faTimers.end(), [](
auto& timer) { timer.Reset(); });
Implementation of cbm::algo::ca::EnumArray class.
Timer class for CA tracking (header)
Class of arrays, which can be accessed by an enum class entry as an index.
MonitorData(const MonitorData &)=default
Copy constructor.
void serialize(Archive &ar, const unsigned int)
~MonitorData()=default
Destructor.
int GetCounterValue(ECounterKey key) const
Gets counter value.
TimerArray< Timer > faTimers
Array of timers.
MonitorData(MonitorData &&)=default
Move constructor.
void IncrementCounter(ECounterKey key, int num)
Increments key counter by a number.
void Reset()
Resets all the counters and timers.
CounterArray< int > faCounters
Array of counters.
int GetNofTimers() const
Gets number of timers.
MonitorData()=default
Default constructor.
void StopTimer(ETimerKey key)
Stops timer.
void IncrementCounter(ECounterKey key)
Increments key counter by 1.
int GetNofCounters() const
Gets number of counters.
void StartTimer(ETimerKey key)
Starts timer.
MonitorData & operator=(MonitorData &&)=default
Move assignment operator.
friend class boost::serialization::access
void AddMonitorData(const MonitorData &other, bool parallel=false)
Adds the other monitor data to this.
const Timer & GetTimer(ETimerKey key) const
Gets timer.
MonitorData & operator=(const MonitorData &)=default
Copy assignment operator.
A timer class for the monitor.
TODO: SZh 8.11.2022: add selection of parameterisation.