The Gaudi Framework
v25r5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GslErrorCount.cpp
Go to the documentation of this file.
1
// $Id: GslErrorCount.cpp,v 1.2 2006/01/10 20:00:05 hmd Exp $
2
// Include files
3
// from Gaudi
4
#include "
GaudiKernel/ToolFactory.h
"
5
#include "
GaudiKernel/MsgStream.h
"
6
#include "
GaudiKernel/IChronoStatSvc.h
"
7
#include "
GaudiKernel/Stat.h
"
8
// local
9
#include "
GslErrorCount.h
"
10
11
// ============================================================================
19
// ============================================================================
20
DECLARE_COMPONENT
(
GslErrorCount
)
21
// ============================================================================
22
23
// ============================================================================
29
// ============================================================================
30
GslErrorCount
::
GslErrorCount
31
( const
std
::
string
&
type
,
32
const
std
::
string
& name ,
33
const
IInterface
* parent )
34
:
base_class
( type, name , parent )
35
, m_counters ()
36
{}
37
// ============================================================================
38
39
// ============================================================================
41
// ============================================================================
42
GslErrorCount::~GslErrorCount
(){}
43
// ============================================================================
44
45
// ============================================================================
51
// ============================================================================
52
StatusCode
GslErrorCount::finalize
()
53
{
54
// printout the Error table
55
MsgStream
log
(
msgSvc
() ,
name
() );
56
const
std::string stars( 78 ,
'*'
);
57
log <<
MSG::INFO
<< stars <<
endmsg
;
58
log <<
MSG::ERROR
<<
m_counters
.size() <<
" GSL errors handled"
<<
endmsg
;
59
for
( Counters::const_iterator error =
m_counters
.begin() ;
60
error !=
m_counters
.end() ; ++error )
61
{
62
log <<
MSG::ERROR
63
<<
" #times "
<< error->second
64
<<
" GSL code "
<< error->first.code
65
<<
" Message '"
<< error->first.reason <<
"'"
66
<<
" File '"
<< error->first.file <<
"'"
67
<<
" Line "
<< error->first.line <<
endmsg
;
68
}
69
log <<
MSG::INFO
<< stars <<
endmsg
;
70
// clear the counters
71
m_counters
.clear();
72
// finalize the base class
73
return
AlgTool::finalize
();
74
}
75
// ============================================================================
76
77
// ============================================================================
84
// ============================================================================
85
StatusCode
GslErrorCount::handle
86
(
const
GslError
& error )
const
87
{
88
// increase the counter
89
m_counters[ error ] += 1 ;
90
//
91
return
StatusCode::SUCCESS
;
92
}
93
// ============================================================================
94
95
96
// ============================================================================
97
// The END
98
// ============================================================================
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition:
MsgStream.h:24
GslError
Helper class to represent GSL errors.
Definition:
GslError.h:17
MsgStream.h
AlgTool::finalize
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition:
AlgTool.cpp:434
Gaudi.Configuration.log
tuple log
Definition:
Configuration.py:13
GslErrorCount::~GslErrorCount
virtual ~GslErrorCount()
destructor (protected and virtual)
Definition:
GslErrorCount.cpp:42
GslErrorCount::finalize
virtual StatusCode finalize()
standard finalization of Tool
Definition:
GslErrorCount.cpp:52
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition:
PluginService.h:36
gaudirun.type
string type
Definition:
gaudirun.py:126
AlgTool::msgSvc
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition:
AlgTool.cpp:79
GslErrorCount.h
StatusCode::SUCCESS
Definition:
StatusCode.h:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:30
IInterface
Definition of the basic interface.
Definition:
IInterface.h:160
extends1
Base class used to extend a class implementing other interfaces.
Definition:
extends.h:10
GslErrorCount::handle
virtual StatusCode handle(const GslError &error) const
handle the GSL error
Definition:
GslErrorCount.cpp:86
GslErrorCount
Concrete GSL error handler It is just counts number of GSL errors.
Definition:
GslErrorCount.h:25
GaudiPython.GaudiAlgs.std
std
Definition:
GaudiAlgs.py:75
Stat.h
MSG::ERROR
Definition:
IMessageSvc.h:21
IChronoStatSvc.h
GslErrorCount::m_counters
Counters m_counters
Definition:
GslErrorCount.h:61
MSG::INFO
Definition:
IMessageSvc.h:19
AlgTool::name
virtual const std::string & name() const
Retrieve full identifying name of the concrete tool object.
Definition:
AlgTool.cpp:51
ToolFactory.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition:
MsgStream.h:244
GaudiGSL
src
Components
GslErrorCount.cpp
Generated on Tue Oct 21 2014 11:36:21 for The Gaudi Framework by
1.8.7