| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# GaudiToolLocal::Counter Class Reference

Collaboration diagram for GaudiToolLocal::Counter:

[legend]
List of all members.

## Detailed Description

simple local counter

Definition at line 61 of file GaudiTool.cpp.

## Public Member Functions
| Counter (const std::string &msg=" Misbalance ")
| ~Counter ()
long | increment (const std::string &object)
long | decrement (const std::string &object)
long | counts (const std::string &object)
void | report () const
## Private Types
typedef std::map< std::string, long > | Map
## Private Attributes
Map | m_map
std::string | m_message

## Member Typedef Documentation

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

Definition at line 88 of file GaudiTool.cpp.

## Constructor & Destructor Documentation

GaudiToolLocal::Counter::Counter | ( | const std::string & | msg = `" Misbalance "` | ) | `[inline]`

Definition at line 65 of file GaudiTool.cpp.

    00066       : m_map     ()
    00067       , m_message ( msg )
    00068     {};

GaudiToolLocal::Counter::~Counter | ( |  | ) | `[inline]`

Definition at line 70 of file GaudiTool.cpp.

    00070 { report() ; m_map.clear() ;}

## Member Function Documentation

long GaudiToolLocal::Counter::increment | ( | const std::string & | object | ) | `[inline]`

Definition at line 72 of file GaudiTool.cpp.

    00072 { return ++m_map[object] ; }

long GaudiToolLocal::Counter::decrement | ( | const std::string & | object | ) | `[inline]`

Definition at line 74 of file GaudiTool.cpp.

    00074 { return --m_map[object] ; }

long GaudiToolLocal::Counter::counts | ( | const std::string & | object | ) | `[inline]`

Definition at line 76 of file GaudiTool.cpp.

    00076 { return   m_map[object] ; }

void GaudiToolLocal::Counter::report | ( |  | ) | const`[inline]`

Definition at line 78 of file GaudiTool.cpp.

References std::cout, and std::endl().

    00079     {
    00080       for ( Map::const_iterator entry = m_map.begin() ;
    00081             m_map.end() != entry ; ++entry )
    00082       {
    00083         if( 0 == entry->second ) { continue ; }
    00084         std::cout << "GaudiTool       WARNING  "          << m_message
    00085                   << "'" << entry->first << "' Counts = " << entry->second
    00086                   << std::endl ;
    00087       }
    00088     };

## Member Data Documentation

Map GaudiToolLocal::Counter::m_map`[private]`

Definition at line 92 of file GaudiTool.cpp.

std::string GaudiToolLocal::Counter::m_message`[private]`

Definition at line 93 of file GaudiTool.cpp.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiAlg/v11r1/src/lib/GaudiTool.cpp