| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

GslErrorCount.cpp
Go to the documentation of this file.
1 // Include files
2 // from Gaudi
3 #include "GaudiKernel/IChronoStatSvc.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/Stat.h"
6 // local
7 #include "GslErrorCount.h"
8
9 // ============================================================================
17 // ============================================================================
18 DECLARE_COMPONENT( GslErrorCount )
19 // ============================================================================
20
21 // ============================================================================
27 // ============================================================================
28 StatusCode GslErrorCount::finalize()
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 // ============================================================================
56 StatusCode GslErrorCount::handle( const GslError& error ) const
57 {
58 ++m_counters[error];
59 return StatusCode::SUCCESS;
60 }
61 // ============================================================================
62
63 // ============================================================================
64 // The END
65 // ============================================================================
StatusCode::SUCCESS
Definition: StatusCode.h:31
GslErrorCount::handle
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslErrorCount.cpp:56
GslError
Helper class to represent GSL errors.
Definition: GslError.h:16
MsgStream.h
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
std::string
STL class.
AlgTool::finalize
StatusCode finalize() override
Definition: AlgTool.cpp:311
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:111
GslErrorCount.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
MsgStream::clear
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:187
GslErrorCount
Concrete GSL error handler It is just counts number of GSL errors.
Definition: GslErrorCount.h:23
Stat.h
IChronoStatSvc.h
GslErrorCount::m_counters
Counters m_counters
Definition: GslErrorCount.h:48
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209