The Gaudi Framework  v33r0 (d5ea422b)
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 68 of file GaudiTool.cpp.

Member Typedef Documentation

◆ Map

Definition at line 99 of file GaudiTool.cpp.

Constructor & Destructor Documentation

◆ Counter()

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

Definition at line 72 of file GaudiTool.cpp.

72 : m_message( std::move( msg ) ){};
T move(T... args)

◆ ~Counter()

GaudiToolLocal::Counter::~Counter ( )
inline

Definition at line 74 of file GaudiTool.cpp.

74 { report(); }
void report() const
make a report
Definition: GaudiTool.cpp:85

Member Function Documentation

◆ counts()

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

current count

Definition at line 83 of file GaudiTool.cpp.

83 { return m_map[object]; }

◆ decrement()

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

make the decrement

Definition at line 81 of file GaudiTool.cpp.

81 { return --m_map[object]; }

◆ increment()

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

make the increment

Definition at line 79 of file GaudiTool.cpp.

79 { return ++m_map[object]; }

◆ report()

void GaudiToolLocal::Counter::report ( ) const
inline

make a report

keep the silence?

Definition at line 85 of file GaudiTool.cpp.

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

Member Data Documentation

◆ m_map

Map GaudiToolLocal::Counter::m_map
private

Definition at line 100 of file GaudiTool.cpp.

◆ m_message

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

Definition at line 101 of file GaudiTool.cpp.


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