| # 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

# GslErrorCount Class Reference

`#include <GslErrorCount.h>`

Inheritance diagram for GslErrorCount:

[legend]
Collaboration diagram for GslErrorCount:

[legend]
List of all members.

## Detailed Description

Concrete GSL eror handler It is just counts number of GSL errors.

Author:
  Vanya Belyaev Ivan.Belyaev@itep.ru

Date:
  30/04/2002

Definition at line 25 of file GslErrorCount.h.

## Public Member Functions
virtual StatusCode | handle (const GslError &error) const
| handle the GSL error
virtual StatusCode | finalize ()
| standard finalization of Tool
| GslErrorCount (const std::string &type, const std::string &name, const IInterface *parent)
| Standard constructor.
virtual | ~GslErrorCount ()
| destructor (protetced and virtual)
## Private Types
typedef std::map< GslError, unsigned int > | Counters
| container of error counters
## Private Attributes
Counters | m_counters

## Member Typedef Documentation

typedef std::map<GslError,unsigned int> GslErrorCount::Counters`[private]`

container of error counters

Definition at line 63 of file GslErrorCount.h.

## Constructor & Destructor Documentation

GslErrorCount::GslErrorCount | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent |
| ) |  |  |

Standard constructor.

Parameters:

  | type | tool type (?)
  | name | tool name
  | parent | pointer to parent

Definition at line 40 of file GslErrorCount.cpp.

    00043   : AlgTool ( type, name , parent )
    00044   , m_counters ()
    00045 { declareInterface<IGslErrorHandler> (this);};

GslErrorCount::~GslErrorCount | ( |  | ) | `[virtual]`

destructor (protetced and virtual)

Definition at line 51 of file GslErrorCount.cpp.

    00051 {};

## Member Function Documentation

StatusCode GslErrorCount::handle | ( | const GslError & | error | ) | const`[virtual]`

handle the GSL error

See also:
  IGslErrorHandler

Parameters:

  | error | error to be handled

See also:
  GslError

Returns:
  status code

Implements IGslErrorHandler.

Definition at line 95 of file GslErrorCount.cpp.

References StatusCode::SUCCESS.

    00096 {
    00097   // increase the counter
    00098   m_counters[ error ] += 1 ;
    00099   //
    00100   return StatusCode::SUCCESS ;
    00101 };

StatusCode GslErrorCount::finalize | ( |  | ) | `[virtual]`

standard finalization of Tool

See also:
  AlgTool

  IAlgTool

Returns:
  status code

Reimplemented from AlgTool.

Definition at line 61 of file GslErrorCount.cpp.

References endreq(), MSG::ERROR, AlgTool::finalize(), MSG::INFO, m_counters, AlgTool::msgSvc(), and AlgTool::name().

    00062 {
    00063   // printout the Error table
    00064   MsgStream log( msgSvc() , name() );
    00065   const std::string stars( 78 , '*' );
    00066   log << MSG::INFO  << stars << endreq ;
    00067   log << MSG::ERROR <<  m_counters.size() << " GSL errors handled" << endreq ;
    00068   for( Counters::const_iterator error = m_counters.begin() ;
    00069        error != m_counters.end() ; ++error )
    00070     {
    00071       log << MSG::ERROR
    00072           << " #times "   << error->second
    00073           << " GSL code " << error->first.code
    00074           << " Message '" << error->first.reason << "'"
    00075           << " File '"    << error->first.file   << "'"
    00076           << " Line "     << error->first.line   << endreq ;
    00077     }
    00078   log << MSG::INFO << stars << endreq ;
    00079   // clear the counters
    00080   m_counters.clear();
    00081   // finalze the base class
    00082   return AlgTool::finalize ();
    00083 };

## Member Data Documentation

Counters GslErrorCount::m_counters`[mutable, private]`

Definition at line 64 of file GslErrorCount.h.

Referenced by finalize().

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiGSL/v6r9/src/Components/GslErrorCount.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiGSL/v6r9/src/Components/GslErrorCount.cpp