The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::Monitoring::Hub Struct Reference

Central entity in a Gaudi application that manages monitoring objects (i.e. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/MonitoringHub.h>

Collaboration diagram for Gaudi::Monitoring::Hub:

Classes

class  Entity
 Wrapper class for arbitrary monitoring objects. More...
 
struct  Sink
 Interface reporting services must implement. More...
 

Public Member Functions

 Hub ()
 
template<typename T>
void registerEntity (std::string c, std::string n, std::string t, T &ent)
 
void registerEntity (Entity ent)
 
template<typename T>
void removeEntity (T &ent)
 
void addSink (Sink *sink)
 
void removeSink (Sink *sink)
 

Private Attributes

std::vector< Sink * > m_sinks
 
std::map< void *, Entitym_entities
 

Detailed Description

Central entity in a Gaudi application that manages monitoring objects (i.e.

counters, histograms, etc.).

The Gaudi::Monitoring::Hub delegates the actual reports to services implementing the Gaudi::Monitoring::Hub::Sink interface.

Definition at line 47 of file MonitoringHub.h.

Constructor & Destructor Documentation

◆ Hub()

Gaudi::Monitoring::Hub::Hub ( )
inline

Definition at line 134 of file MonitoringHub.h.

134{ m_sinks.reserve( 5 ); }
std::vector< Sink * > m_sinks

Member Function Documentation

◆ addSink()

void Gaudi::Monitoring::Hub::addSink ( Sink * sink)
inline

Definition at line 153 of file MonitoringHub.h.

153 {
154 std::for_each( begin( m_entities ), end( m_entities ),
155 [sink]( auto ent ) { sink->registerEntity( ent.second ); } );
156 m_sinks.push_back( sink );
157 }
AttribStringParser::Iterator begin(const AttribStringParser &parser)
std::map< void *, Entity > m_entities

◆ registerEntity() [1/2]

void Gaudi::Monitoring::Hub::registerEntity ( Entity ent)
inline

Definition at line 140 of file MonitoringHub.h.

140 {
141 std::for_each( begin( m_sinks ), end( m_sinks ), [ent]( auto sink ) { sink->registerEntity( ent ); } );
142 m_entities.emplace( ent.id(), std::move( ent ) );
143 }

◆ registerEntity() [2/2]

template<typename T>
void Gaudi::Monitoring::Hub::registerEntity ( std::string c,
std::string n,
std::string t,
T & ent )
inline

Definition at line 137 of file MonitoringHub.h.

137 {
138 registerEntity( { std::move( c ), std::move( n ), std::move( t ), ent } );
139 }
void registerEntity(std::string c, std::string n, std::string t, T &ent)

◆ removeEntity()

template<typename T>
void Gaudi::Monitoring::Hub::removeEntity ( T & ent)
inline

Definition at line 145 of file MonitoringHub.h.

145 {
146 auto it = m_entities.find( &ent );
147 if ( it != m_entities.end() ) {
148 std::for_each( begin( m_sinks ), end( m_sinks ), [&it]( auto sink ) { sink->removeEntity( it->second ); } );
149 m_entities.erase( it );
150 }
151 }

◆ removeSink()

void Gaudi::Monitoring::Hub::removeSink ( Sink * sink)
inline

Definition at line 158 of file MonitoringHub.h.

158 {
159 auto it = std::find( begin( m_sinks ), end( m_sinks ), sink );
160 if ( it != m_sinks.end() ) m_sinks.erase( it );
161 }

Member Data Documentation

◆ m_entities

std::map<void*, Entity> Gaudi::Monitoring::Hub::m_entities
private

Definition at line 165 of file MonitoringHub.h.

◆ m_sinks

std::vector<Sink*> Gaudi::Monitoring::Hub::m_sinks
private

Definition at line 164 of file MonitoringHub.h.


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