The Gaudi Framework
master (594c33fa)
|
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 () |
Public Member Functions inherited from Gaudi::Accumulators::details::CounterArrayInternal< Counter, N > | |
template<typename OWNER , typename FormatName , std::size_t... Ns, typename = typename std::enable_if_t<std::is_invocable_v<FormatName, int>>> | |
CounterArrayInternal (OWNER *owner, FormatName &&fname, std::integer_sequence< std::size_t, Ns... >) | |
constructor with callables for FormatName More... | |
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 More... | |
template<std::size_t... Ns> | |
auto | buffer (std::integer_sequence< std::size_t, Ns... >) |
Method to form an array of buffers. More... | |
Public Member Functions inherited from std::array< Counter, N > | |
Counter | max_size (Counter ... args) |
Counter | rbegin (Counter ... args) |
Counter | crend (Counter ... args) |
Counter | crbegin (Counter ... args) |
Counter | swap (Counter ... args) |
Counter | data (Counter ... args) |
Counter | back (Counter ... args) |
Counter | end (Counter ... args) |
Counter | fill (Counter ... args) |
Counter | empty (Counter ... args) |
Counter | cend (Counter ... args) |
Counter | size (Counter ... args) |
Counter | cbegin (Counter ... args) |
Counter | rend (Counter ... args) |
Counter | front (Counter ... args) |
Counter | at (Counter ... args) |
Counter | operator[] (Counter ... args) |
Counter | begin (Counter ... args) |
Additional Inherited Members | |
Public Attributes inherited from std::array< Counter, N > | |
Counter | elements |
STL member. More... | |
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 90 of file CounterArray.h.
|
inline |
Definition at line 92 of file CounterArray.h.
|
inline |
Definition at line 94 of file CounterArray.h.