![]() |
The Gaudi Framework
master (ff829712)
|
generic class implementing an array of counters The only addition to a raw array is the constructor that allows to build names of the counters automatically from the index of the counter in the array There are 2 possibilities : More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators/CounterArray.h>
Public Member Functions | |
template<typename OWNER, typename FormatName> | |
CounterArray (OWNER *owner, FormatName &&fname) | |
auto | buffer () |
![]() | |
template<typename OWNER, std::invocable< int > FormatName, std::size_t... Ns> | |
CounterArrayInternal (OWNER *owner, FormatName &&fname, std::integer_sequence< std::size_t, Ns... >) | |
constructor with callables for FormatName | |
template<typename OWNER, std::size_t... Ns> | |
CounterArrayInternal (OWNER *owner, std::string_view name, std::integer_sequence< std::size_t, Ns... >) | |
constructor for strings, FormatCounterDefault is used as the default callable | |
template<std::size_t... Ns> | |
auto | buffer (std::integer_sequence< std::size_t, Ns... >) |
Method to form an array of buffers. | |
generic class implementing an array of counters The only addition to a raw array is the constructor that allows to build names of the counters automatically from the index of the counter in the array There are 2 possibilities :
Typical usage : // Array of 5 simple counters with simple names. Names will be MyCounter-0, MyCounter-1, ... CounterArray<Counter<>, 5> counters{ &algo, "MyCounter-{}" }; ++counters[1]; // Array of 5 averaging counters with same simple names CounterArray<AveragingCounter<>, 5> avgCounters{ &algo, "MyCounter-{}" }; avgCounters[2] += 3.14; // Array of 5 simple counters with custom names. Names will be "0^2=0", "1^2=1", "2^2=4", ... CounterArray<Counter<>, 5> customCounters{ &algo, []( int n ) { return fmt::format( "{}^2={}", n, n*n ); } } ++customCounters[3]; // increment via local buffer object auto cbuffer = counters.buffer(); ++cbuffer[4];
Definition at line 89 of file CounterArray.h.
|
inline |
Definition at line 91 of file CounterArray.h.
|
inline |
Definition at line 93 of file CounterArray.h.