The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
StatusCode.h File Reference
#include <boost/preprocessor/facilities/overload.hpp>
#include <functional>
#include <ostream>
#include <type_traits>
#include <utility>
#include <GaudiKernel/Kernel.h>
Include dependency graph for StatusCode.h:

Go to the source code of this file.

Classes

struct  is_StatusCode_enum< T >
 
class  StatusCode
 This class is used for returning status codes from appropriate routines. More...
 
struct  StatusCode::Category
 The category assigned to a StatusCode. More...
 

Macros

#define STATUSCODE_ENUM_DECL(ENUM)
 Declare an enum to be used as StatusCode value.
 
#define STATUSCODE_ENUM_IMPL(...)
 Assign a category to the StatusCode enum declared with STATUSCODE_ENUM_DECL( ENUM )
 
#define STATUSCODE_ENUM_IMPL_1(ENUM)
 
#define STATUSCODE_ENUM_IMPL_2(ENUM, CATEGORY)
 

Functions

bool operator== (const StatusCode &lhs, const StatusCode &rhs)
 

Macro Definition Documentation

◆ STATUSCODE_ENUM_DECL

#define STATUSCODE_ENUM_DECL ( ENUM)
Value:
template <> \
struct is_StatusCode_enum<ENUM> : std::true_type { \
static const StatusCode::Category& instance; \
};
The category assigned to a StatusCode.

Declare an enum to be used as StatusCode value.

Parameters
ENUMenum class

Definition at line 286 of file StatusCode.h.

286#define STATUSCODE_ENUM_DECL( ENUM ) \
287 template <> \
288 struct is_StatusCode_enum<ENUM> : std::true_type { \
289 static const StatusCode::Category& instance; \
290 };

◆ STATUSCODE_ENUM_IMPL

#define STATUSCODE_ENUM_IMPL ( ...)
Value:
BOOST_PP_OVERLOAD( STATUSCODE_ENUM_IMPL_, __VA_ARGS__ )( __VA_ARGS__ )

Assign a category to the StatusCode enum declared with STATUSCODE_ENUM_DECL( ENUM )

Parameters
ENUMenum class
CATEGORY(optional) category, otherwise use default StatusCode category

Definition at line 295 of file StatusCode.h.

◆ STATUSCODE_ENUM_IMPL_1

#define STATUSCODE_ENUM_IMPL_1 ( ENUM)
Value:
static const Category & default_category() noexcept
Default Gaudi StatusCode category.
Definition StatusCode.h:310

Definition at line 297 of file StatusCode.h.

297#define STATUSCODE_ENUM_IMPL_1( ENUM ) \
298 const StatusCode::Category& is_StatusCode_enum<ENUM>::instance = StatusCode::default_category();

◆ STATUSCODE_ENUM_IMPL_2

#define STATUSCODE_ENUM_IMPL_2 ( ENUM,
CATEGORY )
Value:

Definition at line 300 of file StatusCode.h.

300#define STATUSCODE_ENUM_IMPL_2( ENUM, CATEGORY ) \
301 const StatusCode::Category& is_StatusCode_enum<ENUM>::instance = CATEGORY{};

Function Documentation

◆ operator==()

bool operator== ( const StatusCode & lhs,
const StatusCode & rhs )
inline
Note
For code values 0(FAILURE) and 1(SUCCESS) the category is ignored
e.g. sc==StatusCode::SUCCESS is equivalent to sc.isSuccess() for all categories

Definition at line 325 of file StatusCode.h.

325 {
326 return ( lhs.m_code == rhs.m_code ) &&
329 ( lhs.m_cat == rhs.m_cat ) );
330}
code_t m_code
The status code value.
Definition StatusCode.h:260
unsigned long code_t
type of StatusCode value
Definition StatusCode.h:66
const Category * m_cat
The status code category.
Definition StatusCode.h:259