Add category support to StatusCode
The StatusCode now consists of a value and category/domain. By default StatusCodes are created within a "default category". But users can define new categories and StatusCodes using typed enums. The design is mainly borrowed from std::error_code. Main changes: - StatusCode::setCode has been removed - No implicit conversions from/to bool or int anymore. This greatly increases type safety. - Converted all unscoped enums in Gaudi to their own StatusCode category (Clients will have to adjust their code to the scoped enum names (e.g. ERR -> Status::ERR) - Added operator bool() that is equivalent to isSuccess() - Added ternary (bitwise) AND(&) and OR(|) operators to combine StatusCodes according to three-valued logic - Added extensive unit tests for all StatusCode features Impact on clients: - Code that relies on the implicit StatusCode<->bool/int conversion has to be changed to explicitly construct/convert StatusCodes via either the constructor, operator bool() or getCode(). - Clients using Gaudi StatusCodes need to adjust to using the scoped enums. E.g. clients of the ConversionSvc need to change BAD_STORAGE_TYPE to Status::BAD_STORAGE_TYPE when checking for specific StatusCode return types.
Showing
- GaudiAlg/GaudiAlg/TupleObj.h 38 additions, 30 deletionsGaudiAlg/GaudiAlg/TupleObj.h
- GaudiAlg/GaudiAlg/TuplePut.h 5 additions, 5 deletionsGaudiAlg/GaudiAlg/TuplePut.h
- GaudiAlg/src/lib/GaudiCommon.icpp 3 additions, 3 deletionsGaudiAlg/src/lib/GaudiCommon.icpp
- GaudiAlg/src/lib/TupleObj.cpp 34 additions, 6 deletionsGaudiAlg/src/lib/TupleObj.cpp
- GaudiCommonSvc/src/CounterSvc.cpp 6 additions, 6 deletionsGaudiCommonSvc/src/CounterSvc.cpp
- GaudiCommonSvc/src/DataSvc/MultiStoreSvc.cpp 124 additions, 124 deletionsGaudiCommonSvc/src/DataSvc/MultiStoreSvc.cpp
- GaudiCommonSvc/src/DataSvc/PartitionSwitchAlg.cpp 2 additions, 2 deletionsGaudiCommonSvc/src/DataSvc/PartitionSwitchAlg.cpp
- GaudiCommonSvc/src/DataSvc/PartitionSwitchTool.cpp 8 additions, 8 deletionsGaudiCommonSvc/src/DataSvc/PartitionSwitchTool.cpp
- GaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp 10 additions, 10 deletionsGaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp
- GaudiCoreSvc/src/ApplicationMgr/DLLClassManager.cpp 1 addition, 0 deletionsGaudiCoreSvc/src/ApplicationMgr/DLLClassManager.cpp
- GaudiCoreSvc/src/ApplicationMgr/DLLClassManager.h 1 addition, 0 deletionsGaudiCoreSvc/src/ApplicationMgr/DLLClassManager.h
- GaudiHive/src/HiveWhiteBoard.cpp 3 additions, 3 deletionsGaudiHive/src/HiveWhiteBoard.cpp
- GaudiKernel/GaudiKernel/GaudiException.h 2 additions, 24 deletionsGaudiKernel/GaudiKernel/GaudiException.h
- GaudiKernel/GaudiKernel/IConversionSvc.h 13 additions, 3 deletionsGaudiKernel/GaudiKernel/IConversionSvc.h
- GaudiKernel/GaudiKernel/IConverter.h 0 additions, 16 deletionsGaudiKernel/GaudiKernel/IConverter.h
- GaudiKernel/GaudiKernel/ICounterSvc.h 4 additions, 1 deletionGaudiKernel/GaudiKernel/ICounterSvc.h
- GaudiKernel/GaudiKernel/IDataProviderSvc.h 3 additions, 1 deletionGaudiKernel/GaudiKernel/IDataProviderSvc.h
- GaudiKernel/GaudiKernel/IInterface.h 5 additions, 1 deletionGaudiKernel/GaudiKernel/IInterface.h
- GaudiKernel/GaudiKernel/IPartitionControl.h 4 additions, 1 deletionGaudiKernel/GaudiKernel/IPartitionControl.h
- GaudiKernel/GaudiKernel/StatusCode.h 247 additions, 87 deletionsGaudiKernel/GaudiKernel/StatusCode.h
Loading
Please register or sign in to comment