All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GaudiToolLocal::Counter Class Reference

simple local counter More...

Collaboration diagram for GaudiToolLocal::Counter:

Public Member Functions

 Counter (const 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 61 of file GaudiTool.cpp.

Member Typedef Documentation

typedef std::map<std::string,long> GaudiToolLocal::Counter::Map
private

Definition at line 99 of file GaudiTool.cpp.

Constructor & Destructor Documentation

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

Definition at line 66 of file GaudiTool.cpp.

67  : m_map ()
68  , m_message ( msg )
69  {};
GaudiToolLocal::Counter::~Counter ( )
inline

Definition at line 71 of file GaudiTool.cpp.

71 { report() ; m_map.clear() ;}
void report() const
make a report
Definition: GaudiTool.cpp:82

Member Function Documentation

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

current count

Definition at line 80 of file GaudiTool.cpp.

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

make the decrement

Definition at line 78 of file GaudiTool.cpp.

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

make the increment

Definition at line 76 of file GaudiTool.cpp.

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

make a report

keep the silence?

Definition at line 82 of file GaudiTool.cpp.

83  {
85  if ( !GaudiTool::summaryEnabled() ) { return ; } // RETURN
86  //
87  for ( Map::const_iterator entry = m_map.begin() ;
88  m_map.end() != entry ; ++entry )
89  {
90  if( 0 == entry->second ) { continue ; }
91  std::cout << "GaudiTool WARNING " << m_message
92  << "'" << entry->first << "' Counts = " << entry->second
93  << std::endl ;
94  }
95  }
static bool summaryEnabled()
is summary enabled?
Definition: GaudiTool.cpp:135

Member Data Documentation

Map GaudiToolLocal::Counter::m_map
private

Definition at line 100 of file GaudiTool.cpp.

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: