1 #ifndef GAUDIKERNEL_COUNTERHOLDER_H 2 #define GAUDIKERNEL_COUNTERHOLDER_H 25 "CounterHolder template argument must inherit from INamedInterface" );
32 m_counters.emplace( tag, r );
37 auto p = this->m_counters.find( tag );
38 return p != m_counters.end() ? &p->second.get() :
nullptr;
41 template <
typename Callable>
45 [f = std::forward<Callable>( f )](
const auto& p ) { std::invoke( f, p.first, p.second.get() ); } );
50 return m_counters.size();
void forEachCounter(Callable &&f) const
An empty ancester of all counters that knows how to print themselves.
const Gaudi::Accumulators::PrintableCounter * findCounter(const std::string &tag) const
void declareCounter(const std::string &tag, Gaudi::Accumulators::PrintableCounter &r)
Alias for backward compatibility.
IInterface compliant class extending IInterface with the name() method.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
std::map< std::string, std::reference_wrapper< Gaudi::Accumulators::PrintableCounter > > m_counters
Header file for std:chrono::duration-based Counters.
std::mutex m_countersMutex