1 #ifndef GAUDIKERNEL_STATUSCODE_H 2 #define GAUDIKERNEL_STATUSCODE_H 40 m_severity = std::make_shared<const IssueSeverity>(
std::move(sev));
54 d_code(code),m_checked(checked) {}
57 d_code(rhs.d_code), m_checked(rhs.m_checked),
58 m_severity(rhs.m_severity)
63 d_code(rhs.d_code), m_checked(rhs.m_checked),
64 m_severity(
std::move(rhs.m_severity) )
65 { rhs.m_checked =
true; }
69 {
if (
UNLIKELY(s_checking)) check(); }
87 return (d_code == RECOVERABLE);
109 operator unsigned long()
const {
return getCode(); }
120 if (
this == &rhs)
return *
this;
177 mutable bool m_checked =
false;
188 if ( sc.
isSuccess() ) {
return s <<
"SUCCESS" ; }
195 #endif // GAUDIKERNEL_STATUSCODES_H StatusCode(unsigned long code, IssueSeverity &&sev)
StatusCode(unsigned long code, bool checked=false)
void setCode(unsigned long value)
Set the status code by value.
unsigned long getCode() const
Get the status code by value.
bool isSuccess() const
Test for a status code of SUCCESS.
bool m_checked
If the Status code has been checked.
static GAUDI_API void enableChecking()
std::ostream & operator<<(std::ostream &s, const StatusCode &sc)
bool isFailure() const
Test for a status code of FAILURE.
bool operator>(const EventIDBase &lhs, const EventIDBase &rhs)
This class is used for returning status codes from appropriate routines.
Simple RAII class to ignore unchecked StatusCode instances in a scope.
StatusCode(IssueSeverity &&is)
The IMessage is the interface implemented by the message service.
static bool s_checking
Global flag to control if StatusCode need to be checked.
unsigned long d_code
The status code.
bool isRecoverable() const
StatusCode(const StatusCode &rhs)
StatusCode & operator=(const StatusCode &rhs)
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
static GAUDI_API void disableChecking()
StatusCode(StatusCode &&rhs) noexcept
Move constructor.
std::shared_ptr< const IssueSeverity > m_severity
Pointer to a IssueSeverity.
void setChecked() const
Ignore the checking code;.
StatusCode & operator=(unsigned long value)
Assignment operator.