The Gaudi Framework  v28r3 (cc1cf868)
GslErrorCount.cpp
Go to the documentation of this file.
1 // Include files
2 // from Gaudi
5 #include "GaudiKernel/Stat.h"
6 // local
7 #include "GslErrorCount.h"
8 
9 // ============================================================================
17 // ============================================================================
19 // ============================================================================
20 
21 // ============================================================================
27 // ============================================================================
29 {
30  // printout the Error table
31  const std::string stars( 78 , '*' );
32  info() << stars << endmsg ;
33  AlgTool::error() << m_counters.size() << " GSL errors handled" << endmsg ;
34  for( const auto& error : m_counters ) {
36  << " #times " << error.second
37  << " GSL code " << error.first.code
38  << " Message '" << error.first.reason << "'"
39  << " File '" << error.first.file << "'"
40  << " Line " << error.first.line << endmsg ;
41  }
42  info() << stars << endmsg ;
43  // clear the counters
44  m_counters.clear();
45  // finalize the base class
46  return AlgTool::finalize ();
47 }
48 // ============================================================================
49 
50 // ============================================================================
57 // ============================================================================
59 ( const GslError& error ) const
60 {
61  ++m_counters[ error ];
62  return StatusCode::SUCCESS ;
63 }
64 // ============================================================================
65 
66 
67 // ============================================================================
68 // The END
69 // ============================================================================
StatusCode handle(const GslError &error) const override
handle the GSL error
Helper class to represent GSL errors.
Definition: GslError.h:16
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
STL class.
StatusCode finalize() override
Definition: AlgTool.cpp:313
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
Concrete GSL error handler It is just counts number of GSL errors.
Definition: GslErrorCount.h:23
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244