Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  // printout the Error table
30  const std::string stars( 78, '*' );
31  info() << stars << endmsg;
32  AlgTool::error() << m_counters.size() << " GSL errors handled" << endmsg;
33  for ( const auto& error : m_counters ) {
34  AlgTool::error() << " #times " << error.second << " GSL code " << error.first.code << " Message '"
35  << error.first.reason << "'"
36  << " File '" << error.first.file << "'"
37  << " Line " << error.first.line << endmsg;
38  }
39  info() << stars << endmsg;
40  // clear the counters
41  m_counters.clear();
42  // finalize the base class
43  return AlgTool::finalize();
44 }
45 // ============================================================================
46 
47 // ============================================================================
54 // ============================================================================
55 StatusCode GslErrorCount::handle( const GslError& error ) const {
56  ++m_counters[error];
57  return StatusCode::SUCCESS;
58 }
59 // ============================================================================
60 
61 // ============================================================================
62 // The END
63 // ============================================================================
StatusCode handle(const GslError &error) const override
handle the GSL error
Helper class to represent GSL errors.
Definition: GslError.h:16
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Definition: AlgTool.cpp:268
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:171
Concrete GSL error handler It is just counts number of GSL errors.
Definition: GslErrorCount.h:23
Counters m_counters
Definition: GslErrorCount.h:47
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192