The Gaudi Framework  master (cc9a61f4)
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...
class  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.
Definition StatusCode.h:77

Declare an enum to be used as StatusCode value.

Parameters
ENUMenum class

Definition at line 274 of file StatusCode.h.

274#define STATUSCODE_ENUM_DECL( ENUM ) \
275 template <> \
276 struct is_StatusCode_enum<ENUM> : std::true_type { \
277 static const StatusCode::Category& instance; \
278 };

◆ 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 283 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:298

Definition at line 285 of file StatusCode.h.

285#define STATUSCODE_ENUM_IMPL_1( ENUM ) \
286 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 288 of file StatusCode.h.

288#define STATUSCODE_ENUM_IMPL_2( ENUM, CATEGORY ) \
289 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 313 of file StatusCode.h.

313 {
314 return ( lhs.m_code == rhs.m_code ) &&
317 ( lhs.m_cat == rhs.m_cat ) );
318}
code_t m_code
The status code value.
Definition StatusCode.h:248
unsigned long code_t
type of StatusCode value
Definition StatusCode.h:66
const Category * m_cat
The status code category.
Definition StatusCode.h:247