The Gaudi Framework  v32r2 (46d42edc)
StatusCode::Category Class Referenceabstract

The category assigned to a StatusCode. More...

#include <GaudiKernel/StatusCode.h>

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 63 of file StatusCode.h.

Constructor & Destructor Documentation

◆ Category()

constexpr StatusCode::Category::Category ( )
defaultnoexcept

◆ ~Category()

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

Definition at line 65 of file StatusCode.h.

65 {}

Member Function Documentation

◆ isRecoverable()

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

Is code considered recoverable ?

Definition at line 78 of file StatusCode.h.

78 { 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()

Definition at line 75 of file StatusCode.h.

75 { 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.

Definition at line 71 of file StatusCode.h.

71 { return "UNKNOWN(" + std::to_string( code ) + ")"; }
T to_string(T... args)

◆ name()

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

Name of the category.


The documentation for this class was generated from the following file: