| The Gaudi Framework v29r1 (5cd95fa2)

- 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
13 {
15 namespace ReturnCode
16 {
17
18 constexpr int Success = 0x00;
19
20 constexpr int GenericFailure = 0x01;
21
25 constexpr int FailInput = 0x02; //< Error opening file
26 constexpr int AlgorithmFailure = 0x03; //<
27 constexpr int ScheduledStop = 0x04; //< Loop terminated because of user request
28 constexpr int IncidentFailure = 0x05; //< Fatal error in Incident handling
29 constexpr int UnhandledException = 0x06; //<
30 constexpr int CorruptedInput = 0x10; //< Input file showed a corruption
34 constexpr int FinalizationFailure = 0x0b;
36 constexpr int SignalOffset = 0x80; //< Offset for signal-related return codes
37 }
38
51 inline StatusCode setAppReturnCode( SmartIF<IProperty>& appmgr, int value, bool force = false )
52 {
53 if ( appmgr ) {
54 Gaudi::Property<int> returnCode( "ReturnCode", 0 );
55 if ( appmgr->getProperty( &returnCode ).isSuccess() ) {
56 if ( returnCode.value() == 0 || force ) {
57 returnCode.setValue( value );
58 return appmgr->setProperty( returnCode );
59 }
60 // Consider is a success if we do already have an error code.
61 return StatusCode::SUCCESS;
62 }
63 }
64 return StatusCode::FAILURE;
65 }
66
72 inline int getAppReturnCode( const SmartIF<IProperty>& appmgr )
73 {
74 if ( appmgr ) {
75 Gaudi::Property<int> returnCode( "ReturnCode", 0 );
76 if ( appmgr->getProperty( &returnCode ).isSuccess() ) return returnCode.value();
77 }
78 return 0;
79 }
80 }
81 #endif /* APPRETURNCODE_H_ */
Gaudi::getAppReturnCode
int getAppReturnCode(const SmartIF< IProperty > &appmgr)
Get the application (current) return code.
Definition: AppReturnCode.h:72
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:34
StatusCode::SUCCESS
Definition: StatusCode.h:31
SmartIF< IProperty >
Gaudi::Property::setValue
bool setValue(const ValueType &v)
Definition: Property.h:481
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
Gaudi::ReturnCode::GenericFailure
constexpr int GenericFailure
Definition: AppReturnCode.h:20
IProperty::getProperty
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:27
Gaudi::ReturnCode::CorruptedInput
constexpr int CorruptedInput
Definition: AppReturnCode.h:30
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:29
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::ReturnCode::FailInput
constexpr int FailInput
Definition: AppReturnCode.h:25
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:51
Gaudi::ReturnCode::IncidentFailure
constexpr int IncidentFailure
Definition: AppReturnCode.h:28
IProperty.h
Property.h
Gaudi::ReturnCode::AlgorithmFailure
constexpr int AlgorithmFailure
Definition: AppReturnCode.h:26
Gaudi::ReturnCode::SignalOffset
constexpr int SignalOffset
Definition: AppReturnCode.h:36
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:479
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1