The Gaudi Framework  master (37c0b60a)
StatusCode::Category Class Referenceabstract

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/StatusCode.h>

Inheritance diagram for StatusCode::Category:

Public Member Functions

constexpr Category () noexcept=default
 
virtual ~Category ()
 
virtual const char * name () const =0
 Name of the category. More...
 
virtual std::string message (code_t code) const
 Description for code within this category. More...
 
virtual bool isSuccess (code_t code) const
 Is code considered success ? More...
 
virtual bool isRecoverable (code_t code) const
 Is code considered recoverable ? More...
 

Detailed Description

The category assigned to a StatusCode. Derive from this class to implement your own category. The mapping of StatusCode values to success and recoverable conditions can be defined by overriding the appropriate methods.

Definition at line 78 of file StatusCode.h.

Constructor & Destructor Documentation

◆ Category()

constexpr StatusCode::Category::Category ( )
constexprdefaultnoexcept

◆ ~Category()

virtual StatusCode::Category::~Category ( )
inlinevirtual

Definition at line 80 of file StatusCode.h.

80 {}

Member Function Documentation

◆ isRecoverable()

virtual bool StatusCode::Category::isRecoverable ( code_t  code) const
inlinevirtual

Is code considered recoverable ?

Reimplemented in Gaudi::Functional::FilterDecisionErrorCategory.

Definition at line 93 of file StatusCode.h.

93 { return code == static_cast<code_t>( ErrorCode::RECOVERABLE ); }

◆ isSuccess()

virtual bool StatusCode::Category::isSuccess ( code_t  code) const
inlinevirtual

Is code considered success ?

Note
isFailure() cannot be overridden as it is defined as !isSuccess()

Reimplemented in Gaudi::Functional::FilterDecisionErrorCategory.

Definition at line 90 of file StatusCode.h.

90 { return code == static_cast<code_t>( ErrorCode::SUCCESS ); }

◆ message()

virtual std::string StatusCode::Category::message ( code_t  code) const
inlinevirtual

Description for code within this category.

Reimplemented in Gaudi::Functional::FilterDecisionErrorCategory.

Definition at line 86 of file StatusCode.h.

86 { return "UNKNOWN(" + std::to_string( code ) + ")"; }

◆ name()

virtual const char* StatusCode::Category::name ( ) const
pure virtual

Name of the category.

Implemented in Gaudi::Functional::FilterDecisionErrorCategory.


The documentation for this class was generated from the following file:
StatusCode::ErrorCode::SUCCESS
@ SUCCESS
StatusCode::code_t
unsigned long code_t
type of StatusCode value
Definition: StatusCode.h:67
std::to_string
T to_string(T... args)
StatusCode::ErrorCode::RECOVERABLE
@ RECOVERABLE