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
Guards.cpp
Go to the documentation of this file.
1
// $Id: Guards.cpp,v 1.4 2008/11/11 14:43:37 marcocle Exp $
2
// ============================================================================
3
// Include files
4
// ============================================================================
5
// STD & STL
6
// ============================================================================
7
#include <exception>
8
// ============================================================================
9
// GaudiKernel
10
// ============================================================================
11
#include "GaudiKernel/Guards.h"
12
#include "GaudiKernel/System.h"
13
#include "GaudiKernel/MsgStream.h"
14
#include "GaudiKernel/GaudiException.h"
15
// ============================================================================
22
// ============================================================================
23
// Local handle (print) of GaudiException
24
// ============================================================================
25
void
Gaudi::Guards::ExceptionGuard::handle
26
(
const
GaudiException
& exc ,
MsgStream
&
log
)
27
{
28
// the general printout
29
log <<
MSG::FATAL
30
<<
System::typeinfoName
(
typeid
( exc ) )
31
<<
"('"
<< exc.
tag
() <<
"') is caught!"
<<
endmsg
;
32
// print the detailes about the exception:
33
log <<
MSG::ERROR
<< exc <<
endmsg
;
34
// get the status code form the exception:
35
m_sc = exc.
code
() ;
36
}
37
// ============================================================================
38
// Local handle (print) of std::exception
39
// ============================================================================
40
void
Gaudi::Guards::ExceptionGuard::handle
41
(
const
std::exception& exc ,
MsgStream
& log )
42
{
43
// the general printout
44
log <<
MSG::FATAL
45
<<
System::typeinfoName
(
typeid
( exc ) ) <<
" is caught!"
<<
endmsg
;
46
// print the detailes abotu the exception:
47
log <<
MSG::ERROR
<< exc.what() <<
endmsg
;
48
}
49
// ============================================================================
50
// Local handle (print) of unknown exception
51
// ============================================================================
52
void
Gaudi::Guards::ExceptionGuard::handle
53
(
MsgStream
& log )
54
{
55
// the general printout
56
log <<
MSG::FATAL
<<
"UNKNOWN exception is caught!"
<<
endmsg
;
57
}
58
// ============================================================================
59
// dectructor
60
// ============================================================================
61
Gaudi::Guards::ExceptionGuard::~ExceptionGuard
() { m_sc.ignore() ; }
62
// ============================================================================
63
// constructor with standard post-action
64
// ============================================================================
65
Gaudi::Guards::AuditorGuard::AuditorGuard
(
INamedInterface
* obj ,
66
IAuditor
* svc ,
67
IAuditor::StandardEventType
evt
):
68
m_obj(obj),
69
m_objName(),
70
m_svc(svc),
71
m_evt(evt),
72
m_cevt(),
73
m_sc(0),
74
m_customEvtType(false)
75
{
76
i_before
();
77
}
78
Gaudi::Guards::AuditorGuard::AuditorGuard
(
INamedInterface
* obj ,
79
IAuditor
* svc ,
80
IAuditor::CustomEventTypeRef
evt
):
81
m_obj(obj),
82
m_objName(),
83
m_svc(svc),
84
m_evt(
IAuditor
::Initialize),
// Windows needs an explicit value
85
m_cevt(evt),
86
m_sc(0),
87
m_customEvtType(true)
88
{
89
i_before
();
90
}
91
Gaudi::Guards::AuditorGuard::AuditorGuard
(
INamedInterface
* obj ,
92
IAuditor
* svc ,
93
IAuditor::StandardEventType
evt
,
94
const
StatusCode
&
sc
):
95
m_obj(obj),
96
m_objName(),
97
m_svc(svc),
98
m_evt(evt),
99
m_cevt(),
100
m_sc(&sc),
101
m_customEvtType(false)
102
{
103
i_before
();
104
}
105
Gaudi::Guards::AuditorGuard::AuditorGuard
(
INamedInterface
* obj ,
106
IAuditor
* svc ,
107
IAuditor::CustomEventTypeRef
evt
,
108
const
StatusCode
&
sc
):
109
m_obj(obj),
110
m_objName(),
111
m_svc(svc),
112
m_evt(
IAuditor
::Initialize),
// Windows needs an explicit value
113
m_cevt(evt),
114
m_sc(&sc),
115
m_customEvtType(true)
116
{
117
i_before
();
118
}
119
Gaudi::Guards::AuditorGuard::AuditorGuard
(
const
std::string &name ,
120
IAuditor
* svc ,
121
IAuditor::StandardEventType
evt
):
122
m_obj(0),
123
m_objName(name),
124
m_svc(svc),
125
m_evt(evt),
126
m_cevt(),
127
m_sc(0),
128
m_customEvtType(false)
129
{
130
i_before
();
131
}
132
Gaudi::Guards::AuditorGuard::AuditorGuard
(
const
std::string &name ,
133
IAuditor
* svc ,
134
IAuditor::CustomEventTypeRef
evt
):
135
m_obj(0),
136
m_objName(name),
137
m_svc(svc),
138
m_evt(
IAuditor
::Initialize),
// Windows needs an explicit value
139
m_cevt(evt),
140
m_sc(0),
141
m_customEvtType(true)
142
{
143
i_before
();
144
}
145
Gaudi::Guards::AuditorGuard::AuditorGuard
(
const
std::string &name ,
146
IAuditor
* svc ,
147
IAuditor::StandardEventType
evt
,
148
const
StatusCode
&
sc
):
149
m_obj(0),
150
m_objName(name),
151
m_svc(svc),
152
m_evt(evt),
153
m_cevt(),
154
m_sc(&sc),
155
m_customEvtType(false)
156
{
157
i_before
();
158
}
159
Gaudi::Guards::AuditorGuard::AuditorGuard
(
const
std::string &name ,
160
IAuditor
* svc ,
161
IAuditor::CustomEventTypeRef
evt
,
162
const
StatusCode
&
sc
):
163
m_obj(0),
164
m_objName(name),
165
m_svc(svc),
166
m_evt(
IAuditor
::Initialize),
// Windows needs an explicit value
167
m_cevt(evt),
168
m_sc(&sc),
169
m_customEvtType(true)
170
{
171
i_before
();
172
}
173
// ============================================================================
174
// dectructor
175
// ============================================================================
176
Gaudi::Guards::AuditorGuard::~AuditorGuard
()
177
{
178
i_after();
179
}
180
// ============================================================================
182
// ============================================================================
GaudiKernel
src
Lib
Guards.cpp
Generated on Mon Feb 16 2015 11:56:56 for The Gaudi Framework by
1.8.2