The Gaudi Framework  v30r3 (a5ef0a68)
GaudiToolLocal::Counter Class Referencefinal

simple local counter More...

Collaboration diagram for GaudiToolLocal::Counter:

Public Member Functions

 Counter (std::string msg=" Misbalance ")
 
 ~Counter ()
 
long increment (const std::string &object)
 make the increment More...
 
long decrement (const std::string &object)
 make the decrement More...
 
long counts (const std::string &object)
 current count More...
 
void report () const
 make a report More...
 

Private Types

typedef std::map< std::string, long > Map
 

Private Attributes

Map m_map
 
std::string m_message
 

Detailed Description

simple local counter

Definition at line 60 of file GaudiTool.cpp.

Member Typedef Documentation

Definition at line 95 of file GaudiTool.cpp.

Constructor & Destructor Documentation

GaudiToolLocal::Counter::Counter ( std::string  msg = " Misbalance ")
inline

Definition at line 65 of file GaudiTool.cpp.

65 : m_message( std::move( msg ) ){};
T move(T...args)
GaudiToolLocal::Counter::~Counter ( )
inline

Definition at line 67 of file GaudiTool.cpp.

67 { report(); }
void report() const
make a report
Definition: GaudiTool.cpp:78

Member Function Documentation

long GaudiToolLocal::Counter::counts ( const std::string object)
inline

current count

Definition at line 76 of file GaudiTool.cpp.

76 { return m_map[object]; }
long GaudiToolLocal::Counter::decrement ( const std::string object)
inline

make the decrement

Definition at line 74 of file GaudiTool.cpp.

74 { return --m_map[object]; }
long GaudiToolLocal::Counter::increment ( const std::string object)
inline

make the increment

Definition at line 72 of file GaudiTool.cpp.

72 { return ++m_map[object]; }
void GaudiToolLocal::Counter::report ( ) const
inline

make a report

keep the silence?

Definition at line 78 of file GaudiTool.cpp.

79  {
81  if ( !GaudiTool::summaryEnabled() ) {
82  return;
83  } // RETURN
84  //
85  for ( const auto& entry : m_map ) {
86  if ( entry.second ) {
87  std::cout << "GaudiTool WARNING " << m_message << "'" << entry.first << "' Counts = " << entry.second
88  << std::endl;
89  }
90  }
91  }
T endl(T...args)
static bool summaryEnabled()
is summary enabled?
Definition: GaudiTool.cpp:131

Member Data Documentation

Map GaudiToolLocal::Counter::m_map
private

Definition at line 96 of file GaudiTool.cpp.

std::string GaudiToolLocal::Counter::m_message
private

Definition at line 97 of file GaudiTool.cpp.


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