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>
44 std::for_each( m_counters.begin(), m_counters.end(), [f = std::forward<Callable>( f )](
const auto& p ) {
51 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.
auto invoke(F &&f, ArgTypes &&...args) noexcept(noexcept(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))) -> decltype(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))
std::map< std::string, std::reference_wrapper< Gaudi::Accumulators::PrintableCounter > > m_counters
Helper functions to set/get the application return code.
std::mutex m_countersMutex