Gaudi Framework, version v23r5
Home
Generated: Wed Nov 28 2012
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
GaudiGSL
src
Components
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_TOOL_FACTORY
(
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
// ============================================================================
Generated at Wed Nov 28 2012 12:17:12 for Gaudi Framework, version v23r5 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004