The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo > Class Template Reference

internal class implementing a map of histograms More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators/HistogramMap.h>

Inheritance diagram for Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >:
Collaboration diagram for Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >:

Public Member Functions

template<typename OWNER, std::invocable< Key const & > FormatName, std::invocable< Key const & > FormatTitle>
 HistogramMapInternal (OWNER *owner, FormatName &&fname, FormatTitle &&ftitle, typename Histo::AxisTupleType &&allAxis)
 constructor with callables for FormatName and FormatTitle
template<typename OWNER>
 HistogramMapInternal (OWNER *owner, std::string_view name, std::string_view title, typename Histo::AxisTupleType &&allAxis)
 constructor for strings, FormatHistDefaultT is used as the default callable
Histo & operator[] (Key const &k) const
 operator[] method, made thread safe and thus declared const

Private Attributes

std::map< Key, Histo > m_map
std::mutex m_mapLock {}
std::function< Histo &(Key const &)> m_makeHisto

Detailed Description

template<typename Key, typename Histo>
class Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >

internal class implementing a map of histograms

See also
HistogramMap

Definition at line 41 of file HistogramMap.h.

Constructor & Destructor Documentation

◆ HistogramMapInternal() [1/2]

template<typename Key, typename Histo>
template<typename OWNER, std::invocable< Key const & > FormatName, std::invocable< Key const & > FormatTitle>
Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::HistogramMapInternal ( OWNER * owner,
FormatName && fname,
FormatTitle && ftitle,
typename Histo::AxisTupleType && allAxis )
inline

constructor with callables for FormatName and FormatTitle

Definition at line 45 of file HistogramMap.h.

47 : m_makeHisto{ [owner, fname, ftitle, allAxis, this]( Key const& k ) -> Histo& {
48 return m_map
51 .first->second;
52 } } {}
internal class implementing a map of histograms
std::function< Histo &(Key const &)> m_makeHisto

◆ HistogramMapInternal() [2/2]

template<typename Key, typename Histo>
template<typename OWNER>
Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::HistogramMapInternal ( OWNER * owner,
std::string_view name,
std::string_view title,
typename Histo::AxisTupleType && allAxis )
inline

constructor for strings, FormatHistDefaultT is used as the default callable

Definition at line 55 of file HistogramMap.h.

57 : m_makeHisto{ [owner, name, title, allAxis, this]( Key const& k ) -> Histo& {
58 return m_map
62 .first->second;
63 } } {}

Member Function Documentation

◆ operator[]()

template<typename Key, typename Histo>
Histo & Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::operator[] ( Key const & k) const
inline

operator[] method, made thread safe and thus declared const

Definition at line 65 of file HistogramMap.h.

65 {
67 auto it = m_map.find( k );
68 if ( it != m_map.end() ) return it->second;
69 return m_makeHisto( k );
70 }

Member Data Documentation

◆ m_makeHisto

template<typename Key, typename Histo>
std::function<Histo&( Key const& )> Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::m_makeHisto
private

Definition at line 75 of file HistogramMap.h.

◆ m_map

template<typename Key, typename Histo>
std::map<Key, Histo> Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::m_map
mutableprivate

Definition at line 73 of file HistogramMap.h.

◆ m_mapLock

template<typename Key, typename Histo>
std::mutex Gaudi::Accumulators::details::HistogramMapInternal< Key, Histo >::m_mapLock {}
mutableprivate

Definition at line 74 of file HistogramMap.h.

74{};

The documentation for this class was generated from the following file: