The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
AppReturnCode.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
16
#pragma once
17
18
#include <
Gaudi/Property.h
>
19
#include <
GaudiKernel/IProperty.h
>
20
21
namespace
Gaudi
{
23
namespace
ReturnCode
{
24
25
constexpr
int
Success
= 0x00;
26
27
constexpr
int
GenericFailure
= 0x01;
28
32
constexpr
int
FailInput
= 0x02;
//< Error opening file
33
constexpr
int
AlgorithmFailure
= 0x03;
//<
34
constexpr
int
ScheduledStop
= 0x04;
//< Loop terminated because of user request
35
constexpr
int
IncidentFailure
= 0x05;
//< Fatal error in Incident handling
36
constexpr
int
UnhandledException
= 0x06;
//<
37
constexpr
int
CorruptedInput
= 0x10;
//< Input file showed a corruption
41
constexpr
int
FinalizationFailure
= 0x0b;
43
constexpr
int
SignalOffset
= 0x80;
//< Offset for signal-related return codes
44
}
// namespace ReturnCode
45
58
inline
StatusCode
setAppReturnCode
(
SmartIF<IProperty>
& appmgr,
int
value,
bool
force =
false
) {
59
if
( appmgr ) {
60
Gaudi::Property<int>
returnCode(
"ReturnCode"
, 0 );
61
if
( appmgr->getProperty( &returnCode ).isSuccess() ) {
62
if
( returnCode.
value
() == 0 || force ) {
63
returnCode.
setValue
( value );
64
return
appmgr->setProperty( returnCode );
65
}
66
// Consider is a success if we do already have an error code.
67
return
StatusCode::SUCCESS
;
68
}
69
}
70
return
StatusCode::FAILURE
;
71
}
72
78
inline
int
getAppReturnCode
(
const
SmartIF<IProperty>
& appmgr ) {
79
if
( appmgr ) {
80
Gaudi::Property<int>
returnCode(
"ReturnCode"
, 0 );
81
if
( appmgr->getProperty( &returnCode ).isSuccess() )
return
returnCode.
value
();
82
}
83
return
0;
84
}
85
}
// namespace Gaudi
Property.h
IProperty.h
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
Gaudi::Property::value
const ValueType & value() const
Definition
Property.h:246
Gaudi::Property::setValue
bool setValue(const ValueType &v)
Definition
Property.h:248
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition
AppReturnCode.h:34
Gaudi::ReturnCode::FailInput
constexpr int FailInput
Definition
AppReturnCode.h:32
Gaudi::ReturnCode::AlgorithmFailure
constexpr int AlgorithmFailure
Definition
AppReturnCode.h:33
Gaudi::ReturnCode::CorruptedInput
constexpr int CorruptedInput
Definition
AppReturnCode.h:37
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition
AppReturnCode.h:36
Gaudi::ReturnCode::IncidentFailure
constexpr int IncidentFailure
Definition
AppReturnCode.h:35
Gaudi::ReturnCode
ApplicationMgr return code definitions.
Definition
AppReturnCode.h:23
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition
AppReturnCode.h:41
Gaudi::ReturnCode::GenericFailure
constexpr int GenericFailure
Definition
AppReturnCode.h:27
Gaudi::ReturnCode::SignalOffset
constexpr int SignalOffset
Definition
AppReturnCode.h:43
Gaudi::ReturnCode::Success
constexpr int Success
Definition
AppReturnCode.h:25
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::getAppReturnCode
int getAppReturnCode(const SmartIF< IProperty > &appmgr)
Get the application (current) return code.
Definition
AppReturnCode.h:78
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition
AppReturnCode.h:58
GaudiKernel
include
GaudiKernel
AppReturnCode.h
Generated on
for The Gaudi Framework by
1.17.0