The most simple guard - it execute the certain code withing typical "try {} catch" clause, used in Auditor, Algorithm, AlgTool, etc.
More...
#include <GaudiKernel/Guards.h>
|
| template<class OBJECT , class FUNCTION > |
| | ExceptionGuard (OBJECT obj, FUNCTION fun, MsgStream &log, IExceptionSvc *svc=0) |
| |
| | ~ExceptionGuard () |
| | destructor
|
| |
| const StatusCode & | code () const |
| | the result of function evaluation
|
| |
| | operator const StatusCode & () const |
| | cast operator, useful for the implicit conversions
|
| |
| template<class OBJECT , class FUNCTION > |
| | ExceptionGuard (OBJECT obj, FUNCTION fun, MsgStream &log, IExceptionSvc *svc=0) |
| |
| | ~ExceptionGuard () |
| | destructor
|
| |
| const StatusCode & | code () const |
| | the result of function evaluation
|
| |
| | operator const StatusCode & () const |
| | cast operator, useful for the implicit conversions
|
| |
The most simple guard - it execute the certain code withing typical "try {} catch" clause, used in Auditor, Algorithm, AlgTool, etc.
. classes
The usage is fairly trivial:
Gaudi::Guards::Guard guard
( this ,
log ) ;
The utility could be reused for member-function, regular functions, etc.. It could be easily combined with STL-idioms Essentially it required only the semantical validity of the expression "StatusCode sc = fun(obj)"
- Author
- Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
- Date
- 2007-03-07
Definition at line 108 of file Guards.h.
template<class OBJECT , class FUNCTION >
< execute the functor
Definition at line 118 of file Guards.h.
{
try
{
}
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj , e ) ; }
}
catch ( const std::exception& e )
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj , e ) ; }
}
catch ( ... )
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj ) ; }
}
}
| Gaudi::Guards::ExceptionGuard::~ExceptionGuard |
( |
| ) |
|
| Gaudi::Guards::ExceptionGuard::ExceptionGuard |
( |
| ) |
|
|
private |
default constructor is disabled
| Gaudi::Guards::ExceptionGuard::ExceptionGuard |
( |
const ExceptionGuard & |
| ) |
|
|
private |
template<class OBJECT , class FUNCTION >
< execute the functor
Definition at line 118 of file Guards.h.
{
try
{
}
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj , e ) ; }
}
catch ( const std::exception& e )
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj , e ) ; }
}
catch ( ... )
{
if ( 0 != svc ) {
m_sc = svc ->
handle ( *obj ) ; }
}
}
| Gaudi::Guards::ExceptionGuard::~ExceptionGuard |
( |
| ) |
|
| Gaudi::Guards::ExceptionGuard::ExceptionGuard |
( |
| ) |
|
|
private |
default constructor is disabled
| Gaudi::Guards::ExceptionGuard::ExceptionGuard |
( |
const ExceptionGuard & |
| ) |
|
|
private |
| const StatusCode& Gaudi::Guards::ExceptionGuard::code |
( |
| ) |
const |
|
inline |
the result of function evaluation
Definition at line 154 of file Guards.h.
| const StatusCode& Gaudi::Guards::ExceptionGuard::code |
( |
| ) |
const |
|
inline |
the result of function evaluation
Definition at line 154 of file Guards.h.
| void Gaudi::Guards::ExceptionGuard::handle |
( |
const std::exception & |
e, |
|
|
MsgStream & |
s |
|
) |
| |
|
protected |
local handler of std::exception
Definition at line 41 of file Guards.cpp.
| void Gaudi::Guards::ExceptionGuard::handle |
( |
const std::exception & |
e, |
|
|
MsgStream & |
s |
|
) |
| |
|
protected |
local handler of std::exception
| void Gaudi::Guards::ExceptionGuard::handle |
( |
MsgStream & |
s | ) |
|
|
protected |
local handler of UNKNOWN exceptions
Definition at line 53 of file Guards.cpp.
| void Gaudi::Guards::ExceptionGuard::handle |
( |
MsgStream & |
s | ) |
|
|
protected |
local handler of UNKNOWN exceptions
| Gaudi::Guards::ExceptionGuard::operator const StatusCode & |
( |
| ) |
const |
|
inline |
cast operator, useful for the implicit conversions
Definition at line 156 of file Guards.h.
| Gaudi::Guards::ExceptionGuard::operator const StatusCode & |
( |
| ) |
const |
|
inline |
cast operator, useful for the implicit conversions
Definition at line 156 of file Guards.h.
status code : result of function evaluation
Definition at line 173 of file Guards.h.
The documentation for this class was generated from the following files:
- InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/Guards.h
- InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/Guards.h
- GaudiKernel/src/Lib/Guards.cpp