The Gaudi Framework
v25r3
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
21
// ============================================================================
27
// ============================================================================
28
DECLARE_COMPONENT
(
GslErrorCount
)
29
// ============================================================================
30
31
// ============================================================================
37
// ============================================================================
38
GslErrorCount
::
GslErrorCount
39
( const
std
::
string
&
type
,
40
const
std
::
string
& name ,
41
const
IInterface
* parent )
42
:
base_class
( type, name , parent )
43
, m_counters ()
44
{}
45
// ============================================================================
46
47
// ============================================================================
49
// ============================================================================
50
GslErrorCount::~GslErrorCount
(){}
51
// ============================================================================
52
53
// ============================================================================
59
// ============================================================================
60
StatusCode
GslErrorCount::finalize
()
61
{
62
// printout the Error table
63
MsgStream
log
(
msgSvc
() ,
name
() );
64
const
std::string stars( 78 ,
'*'
);
65
log <<
MSG::INFO
<< stars <<
endmsg
;
66
log <<
MSG::ERROR
<<
m_counters
.size() <<
" GSL errors handled"
<<
endmsg
;
67
for
( Counters::const_iterator error =
m_counters
.begin() ;
68
error !=
m_counters
.end() ; ++error )
69
{
70
log <<
MSG::ERROR
71
<<
" #times "
<< error->second
72
<<
" GSL code "
<< error->first.code
73
<<
" Message '"
<< error->first.reason <<
"'"
74
<<
" File '"
<< error->first.file <<
"'"
75
<<
" Line "
<< error->first.line <<
endmsg
;
76
}
77
log <<
MSG::INFO
<< stars <<
endmsg
;
78
// clear the counters
79
m_counters
.clear();
80
// finalize the base class
81
return
AlgTool::finalize
();
82
}
83
// ============================================================================
84
85
// ============================================================================
92
// ============================================================================
93
StatusCode
GslErrorCount::handle
94
(
const
GslError
& error )
const
95
{
96
// increase the counter
97
m_counters[ error ] += 1 ;
98
//
99
return
StatusCode::SUCCESS
;
100
}
101
// ============================================================================
102
103
104
// ============================================================================
105
// The END
106
// ============================================================================
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:428
Gaudi.Configuration.log
tuple log
Definition:
Configuration.py:13
GslErrorCount::~GslErrorCount
virtual ~GslErrorCount()
destructor (protected and virtual)
Definition:
GslErrorCount.cpp:50
GslErrorCount::finalize
virtual StatusCode finalize()
standard finalization of Tool
Definition:
GslErrorCount.cpp:60
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition:
PluginService.h:35
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:94
GslErrorCount
Concrete GSL error handler It is just counts number of GSL errors.
Definition:
GslErrorCount.h:25
GaudiPython.GaudiAlgs.std
std
AIDA -> ROTO converter.
Definition:
GaudiAlgs.py:73
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:243
GaudiGSL
src
Components
GslErrorCount.cpp
Generated on Wed Jul 9 2014 09:54:13 for The Gaudi Framework by
1.8.7