The Gaudi Framework
v26r1
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
StatusCode.cpp
Go to the documentation of this file.
1
#define GAUDIKERNEL_STATUSCODE_CPP 1
2
3
#include "GaudiKernel/StatusCode.h"
4
#include "GaudiKernel/System.h"
5
#include "GaudiKernel/Bootstrap.h"
6
#include "GaudiKernel/IMessageSvc.h"
7
#include "GaudiKernel/IStatusCodeSvc.h"
8
#include "GaudiKernel/ISvcLocator.h"
9
#include "GaudiKernel/MsgStream.h"
10
#include "GaudiKernel/IssueSeverity.h"
11
#include <fstream>
12
#include <iostream>
13
#include <sstream>
14
#include <stdlib.h>
15
#include <exception>
16
17
bool
StatusCode::s_checking
(
false
);
18
19
void
StatusCode::enableChecking
() {
20
s_checking
=
true
;
21
}
22
23
void
StatusCode::disableChecking
() {
24
s_checking
=
false
;
25
}
26
27
bool
StatusCode::checkingEnabled
() {
28
return
s_checking
;
29
}
30
31
const
IssueSeverity
&
StatusCode::severity
()
const
{
32
static
IssueSeverity
dummy;
33
if
(
m_severity
)
return
*
m_severity
;
34
else
return
dummy;
35
}
36
37
void
StatusCode::check
() {
38
39
if
(!
m_checked
&& !
GaudiException::s_proc
&& !std::uncaught_exception() ) {
40
41
SmartIF<IMessageSvc>
msg
(
Gaudi::svcLocator
());
42
43
SmartIF<IStatusCodeSvc>
scs(
Gaudi::svcLocator
()->service(
"StatusCodeSvc"
));
44
45
const
size_t
depth = 21;
46
void
* addresses[depth];
47
48
std::string lib, fnc;
49
void
* addr = 0;
51
if
(
System::backTrace
(addresses, depth)) {
52
53
for
(
size_t
idx: {2, 3})
54
if
(
System::getStackLevel
(addresses[idx], addr, fnc, lib) &&
55
fnc !=
"StatusCode::~StatusCode()"
) {
56
57
if
(scs) {
58
scs->regFnc(fnc, lib);
59
}
else
{
60
MsgStream
log
(msg,
"StatusCode"
);
61
log <<
MSG::WARNING
<<
"Unchecked in "
<< fnc
62
<<
" ("
<< lib <<
")"
<<
endmsg
;
63
}
64
break
;
65
}
66
67
}
68
}
69
}
GaudiKernel
src
Lib
StatusCode.cpp
Generated on Mon Feb 16 2015 11:56:56 for The Gaudi Framework by
1.8.2