Skip to content
Snippets Groups Projects
Commit 22acc16e authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

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.
parent d31c533b
No related branches found
No related tags found
Loading
Showing
with 513 additions and 331 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment