#include <GaudiKernel/StatusCode.h>
Collaboration diagram for StatusCode:
Public Types | |
FAILURE = 0 | |
SUCCESS = 1 | |
RECOVERABLE = 2 | |
enum | { FAILURE = 0, SUCCESS = 1, RECOVERABLE = 2 } |
Public Member Functions | |
StatusCode () | |
Constructor. | |
StatusCode (unsigned long code, const IssueSeverity &) | |
StatusCode (unsigned long code, bool checked=false) | |
StatusCode (const StatusCode &sc) | |
~StatusCode () | |
Destructor. | |
bool | isSuccess () const |
Test for a status code of SUCCESS. | |
bool | isFailure () const |
Test for a status code of FAILURE. | |
bool | isRecoverable () const |
unsigned long | getCode () const |
Get the status code by value. | |
void | setCode (unsigned long) |
Set the status code by value. | |
void | setChecked () const |
Ignore the checking code;. | |
void | ignore () const |
operator unsigned long () const | |
Cast operator. | |
const IssueSeverity & | severity () const |
Severity. | |
StatusCode & | operator= (unsigned long value) |
Assignment operator. | |
StatusCode & | operator= (const StatusCode &rhs) |
operator IgnoreError () const | |
Static Public Member Functions | |
static void | enableChecking () |
static void | disableChecking () |
Static Protected Member Functions | |
static IssueSeverity * | cloneSeverity (const IssueSeverity *) |
Protected Attributes | |
unsigned long | d_code |
The status code. The status code. | |
bool | m_checked |
If the Status code has been checked. | |
IssueSeverity * | m_severity |
Pointer to a IssueSeverity. | |
Static Protected Attributes | |
static bool | s_checking |
Global flag to control if StatusCode need to be checked. | |
Friends | |
bool | operator< (const StatusCode &a, const StatusCode &b) |
Comparison operator. | |
bool | operator> (const StatusCode &a, const StatusCode &b) |
Comparison operator. |
Pere Mato
Sebastien Ponce
Definition at line 24 of file StatusCode.h.
anonymous enum |
Definition at line 26 of file StatusCode.h.
00026 { 00027 FAILURE = 0, 00028 SUCCESS = 1, 00029 RECOVERABLE = 2 00030 };
StatusCode::StatusCode | ( | ) | [inline] |
Constructor.
Definition at line 102 of file StatusCode.h.
00102 : 00103 d_code(SUCCESS), m_checked(false), m_severity(0) {}
StatusCode::StatusCode | ( | unsigned long | code, | |
const IssueSeverity & | ||||
) | [inline] |
Definition at line 108 of file StatusCode.h.
00108 : 00109 d_code(code),m_checked(false), m_severity(cloneSeverity(&sev)) { 00110 }
StatusCode::StatusCode | ( | unsigned long | code, | |
bool | checked = false | |||
) | [inline] |
Definition at line 105 of file StatusCode.h.
00105 : 00106 d_code(code),m_checked(checked), m_severity(0) {}
StatusCode::StatusCode | ( | const StatusCode & | sc | ) | [inline] |
Definition at line 112 of file StatusCode.h.
00112 { 00113 d_code = rhs.d_code; 00114 m_checked = rhs.m_checked; 00115 rhs.m_checked = true; 00116 m_severity = rhs.m_severity ? cloneSeverity(rhs.m_severity) : 0; 00117 }
StatusCode::~StatusCode | ( | ) |
Destructor.
bool StatusCode::isSuccess | ( | ) | const [inline] |
Test for a status code of SUCCESS.
N.B. This is the only case where a function has succeeded.
Definition at line 129 of file StatusCode.h.
bool StatusCode::isFailure | ( | ) | const [inline] |
Test for a status code of FAILURE.
N.B. This is a specific type of failure where there aren't any more appropriate staus codes. To test for any failure use : if ( !StatusCode.isSuccess() ) ...
Definition at line 134 of file StatusCode.h.
bool StatusCode::isRecoverable | ( | ) | const [inline] |
Definition at line 139 of file StatusCode.h.
00139 { 00140 m_checked = true; 00141 return (d_code == RECOVERABLE); 00142 }
unsigned long StatusCode::getCode | ( | ) | const [inline] |
void StatusCode::setCode | ( | unsigned | long | ) | [inline] |
void StatusCode::setChecked | ( | ) | const [inline] |
Ignore the checking code;.
Definition at line 154 of file StatusCode.h.
00154 { 00155 m_checked = true; 00156 }
void StatusCode::ignore | ( | ) | const [inline] |
StatusCode::operator unsigned long | ( | ) | const [inline] |
const IssueSeverity& StatusCode::severity | ( | ) | const |
Severity.
StatusCode & StatusCode::operator= | ( | unsigned long | value | ) | [inline] |
StatusCode & StatusCode::operator= | ( | const StatusCode & | rhs | ) | [inline] |
Definition at line 119 of file StatusCode.h.
00119 { 00120 if (this == &rhs) return *this; // Protection against self-assignment 00121 d_code = rhs.d_code; 00122 m_checked = rhs.m_checked; 00123 rhs.m_checked = true; 00124 if (m_severity) delete m_severity; 00125 m_severity = rhs.m_severity ? cloneSeverity(rhs.m_severity): 0; 00126 return *this; 00127 }
StatusCode::operator IgnoreError | ( | ) | const [inline] |
Definition at line 82 of file StatusCode.h.
00082 { 00083 m_checked = true; 00084 return IgnoreError(); 00085 }
static void StatusCode::enableChecking | ( | ) | [static] |
static void StatusCode::disableChecking | ( | ) | [static] |
static IssueSeverity* StatusCode::cloneSeverity | ( | const IssueSeverity * | ) | [static, protected] |
bool operator< | ( | const StatusCode & | a, | |
const StatusCode & | b | |||
) | [friend] |
bool operator> | ( | const StatusCode & | a, | |
const StatusCode & | b | |||
) | [friend] |
unsigned long StatusCode::d_code [protected] |
bool StatusCode::m_checked [mutable, protected] |
IssueSeverity* StatusCode::m_severity [protected] |
bool StatusCode::s_checking [static, protected] |
Global flag to control if StatusCode need to be checked.
Definition at line 97 of file StatusCode.h.