The Gaudi Framework  v30r3 (a5ef0a68)
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 ) {
35  AlgTool::error() << " #times " << error.second << " GSL code " << error.first.code << " Message '"
36  << error.first.reason << "'"
37  << " File '" << error.first.file << "'"
38  << " Line " << error.first.line << endmsg;
39  }
40  info() << stars << endmsg;
41  // clear the counters
42  m_counters.clear();
43  // finalize the base class
44  return AlgTool::finalize();
45 }
46 // ============================================================================
47 
48 // ============================================================================
55 // ============================================================================
57 {
58  ++m_counters[error];
59  return StatusCode::SUCCESS;
60 }
61 // ============================================================================
62 
63 // ============================================================================
64 // The END
65 // ============================================================================
StatusCode handle(const GslError &error) const override
handle the GSL error
Helper class to represent GSL errors.
Definition: GslError.h:16
STL class.
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Definition: AlgTool.cpp:293
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:187
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Concrete GSL error handler It is just counts number of GSL errors.
Definition: GslErrorCount.h:23
Counters m_counters
Definition: GslErrorCount.h:48
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209