GslErrorCount Class Reference

Concrete GSL error handler It is just counts number of GSL errors. More...

#include <src/Components/GslErrorCount.h>

Inheritance diagram for GslErrorCount:
Collaboration diagram for GslErrorCount:

Public Member Functions

StatusCode handle (const GslError &error) const override
 handle the GSL error More...
 
StatusCode finalize () override
 standard finalization of Tool More...
 
 GslErrorCount (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
 ~GslErrorCount () override=default
 destructor (protected and virtual) More...
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Private Types

typedef std::map< GslError, unsigned int > Counters
 container of error counters More...
 

Private Attributes

Counters m_counters
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

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

Author
Vanya Belyaev Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
30/04/2002

Definition at line 23 of file GslErrorCount.h.

Member Typedef Documentation

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

container of error counters

Definition at line 57 of file GslErrorCount.h.

Constructor & Destructor Documentation

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

Standard constructor.

Parameters
typetool type (?)
nametool name
parentpointer to parent

Definition at line 29 of file GslErrorCount.cpp.

32  : base_class ( type, name , parent )
33 {}
extends base_class
Typedef to this class.
Definition: extends.h:14
string type
Definition: gaudirun.py:151
GslErrorCount::~GslErrorCount ( )
overridedefault

destructor (protected and virtual)

Member Function Documentation

StatusCode GslErrorCount::finalize ( )
override

standard finalization of Tool

See also
AlgTool
IAlgTool
Returns
status code

Definition at line 43 of file GslErrorCount.cpp.

44 {
45  // printout the Error table
46  MsgStream log( msgSvc() , name() );
47  const std::string stars( 78 , '*' );
48  log << MSG::INFO << stars << endmsg ;
49  log << MSG::ERROR << m_counters.size() << " GSL errors handled" << endmsg ;
50  for( const auto& error : m_counters )
51  {
52  log << MSG::ERROR
53  << " #times " << error.second
54  << " GSL code " << error.first.code
55  << " Message '" << error.first.reason << "'"
56  << " File '" << error.first.file << "'"
57  << " Line " << error.first.line << endmsg ;
58  }
59  log << MSG::INFO << stars << endmsg ;
60  // clear the counters
61  m_counters.clear();
62  // finalize the base class
63  return AlgTool::finalize ();
64 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode finalize() override
Definition: AlgTool.cpp:395
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
Counters m_counters
Definition: GslErrorCount.h:58
StatusCode GslErrorCount::handle ( const GslError error) const
override

handle the GSL error

See also
IGslErrorHandler
Parameters
errorerror to be handled
See also
GslError
Returns
status code

Definition at line 76 of file GslErrorCount.cpp.

77 {
78  ++m_counters[ error ];
79  return StatusCode::SUCCESS ;
80 }
Counters m_counters
Definition: GslErrorCount.h:58

Member Data Documentation

Counters GslErrorCount::m_counters
mutableprivate

Definition at line 58 of file GslErrorCount.h.


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