| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

AppReturnCode.h
Go to the documentation of this file.
1
6 #ifndef APPRETURNCODE_H_
7 #define APPRETURNCODE_H_
8
9 #include "GaudiKernel/IProperty.h"
10 #include "GaudiKernel/Property.h"
11
12 namespace Gaudi {
14 namespace ReturnCode {
15
16 constexpr int Success = 0x00;
17
18 constexpr int GenericFailure = 0x01;
19
23 constexpr int FailInput = 0x02; //< Error opening file
24 constexpr int AlgorithmFailure = 0x03; //<
25 constexpr int ScheduledStop = 0x04; //< Loop terminated because of user request
26 constexpr int IncidentFailure = 0x05; //< Fatal error in Incident handling
27 constexpr int UnhandledException = 0x06; //<
28 constexpr int CorruptedInput = 0x10; //< Input file showed a corruption
32 constexpr int FinalizationFailure = 0x0b;
34 constexpr int SignalOffset = 0x80; //< Offset for signal-related return codes
35
36 }
37
50 inline StatusCode setAppReturnCode(SmartIF<IProperty> &appmgr, int value, bool force = false) {
51 if (appmgr) {
52 IntegerProperty returnCode("ReturnCode", 0);
53 if (appmgr->getProperty(&returnCode).isSuccess()) {
54 if (returnCode.value() == 0 || force) {
55 returnCode.setValue(value);
56 return appmgr->setProperty(returnCode);
57 }
58 // Consider is a success if we do already have an error code.
59 return StatusCode::SUCCESS;
60 }
61 }
62 return StatusCode::FAILURE;
63 }
64
70 inline int getAppReturnCode(const SmartIF<IProperty> &appmgr) {
71 if (appmgr) {
72 IntegerProperty returnCode("ReturnCode", 0);
73 if (appmgr->getProperty(&returnCode).isSuccess())
74 return returnCode.value();
75 }
76 return 0;
77 }
78 }
79 #endif /* APPRETURNCODE_H_ */
Gaudi::getAppReturnCode
int getAppReturnCode(const SmartIF< IProperty > &appmgr)
Get the application (current) return code.
Definition: AppReturnCode.h:70
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:32
SmartIF< IProperty >
IProperty::getProperty
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Gaudi::ReturnCode::GenericFailure
constexpr int GenericFailure
Definition: AppReturnCode.h:18
PropertyWithVerifier::setValue
bool setValue(const TYPE &value) override
implementation of PropertyWithValue::setValue
Definition: Property.h:406
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
Gaudi::ReturnCode::CorruptedInput
constexpr int CorruptedInput
Definition: AppReturnCode.h:28
SimpleProperty< int >
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:27
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IProperty::setProperty
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
Gaudi::ReturnCode::FailInput
constexpr int FailInput
Definition: AppReturnCode.h:23
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
Gaudi::ReturnCode::IncidentFailure
constexpr int IncidentFailure
Definition: AppReturnCode.h:26
IProperty.h
Property.h
Gaudi::ReturnCode::AlgorithmFailure
constexpr int AlgorithmFailure
Definition: AppReturnCode.h:24
Gaudi::ReturnCode::SignalOffset
constexpr int SignalOffset
Definition: AppReturnCode.h:34
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1