|
Gaudi Framework, version v21r4 |
| Home | Generated: 7 Sep 2009 |
#include <GaudiKernel/StatusCode.h>

Definition at line 25 of file StatusCode.h.
Public Types | |
| enum | { FAILURE = 0, SUCCESS = 1, RECOVERABLE = 2 } |
Public Member Functions | |
| StatusCode () | |
| Constructor. | |
| StatusCode (unsigned long code, const IssueSeverity &sev) | |
| StatusCode (unsigned long code, bool checked=false) | |
| StatusCode (const StatusCode &rhs) | |
| GAUDI_API | ~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 value) |
| Set the status code by value. | |
| void | setChecked () const |
| Ignore the checking code;. | |
| void | ignore () const |
| operator unsigned long () const | |
| Cast operator. | |
| GAUDI_API 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 GAUDI_API void | enableChecking () |
| static GAUDI_API void | disableChecking () |
Static Protected Member Functions | |
| static GAUDI_API IssueSeverity * | cloneSeverity (const IssueSeverity *) |
Protected Attributes | |
| unsigned long | d_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. | |
| anonymous enum |
Definition at line 27 of file StatusCode.h.
00027 { 00028 FAILURE = 0, 00029 SUCCESS = 1, 00030 RECOVERABLE = 2 00031 };
| StatusCode::StatusCode | ( | ) | [inline] |
Constructor.
Definition at line 34 of file StatusCode.h.
00034 : 00035 d_code(SUCCESS), m_checked(false), m_severity(0) {} StatusCode( unsigned long code, const IssueSeverity& sev ):
| StatusCode::StatusCode | ( | unsigned long | code, | |
| const IssueSeverity & | sev | |||
| ) | [inline] |
Definition at line 36 of file StatusCode.h.
00036 : 00037 d_code(code),m_checked(false), m_severity(cloneSeverity(&sev)) {} StatusCode( unsigned long code, bool checked = false ):
| StatusCode::StatusCode | ( | unsigned long | code, | |
| bool | checked = false | |||
| ) | [inline] |
Definition at line 38 of file StatusCode.h.
00038 : 00039 d_code(code),m_checked(checked), m_severity(0) {}
| StatusCode::StatusCode | ( | const StatusCode & | rhs | ) | [inline] |
Definition at line 41 of file StatusCode.h.
00041 : 00042 d_code(rhs.d_code), m_checked(rhs.m_checked), 00043 m_severity(rhs.m_severity ? cloneSeverity(rhs.m_severity) : 0) 00044 { rhs.m_checked = true; }
| StatusCode::~StatusCode | ( | ) |
Destructor.
: (MCl) use backTrace(std::string&, const int, const int) instead
Definition at line 38 of file StatusCode.cpp.
00038 { 00039 if(s_checking) { 00040 00041 if (!m_checked ) { 00042 00043 SmartIF<IMessageSvc> msg(Gaudi::svcLocator()); 00044 00045 SmartIF<IStatusCodeSvc> scs(Gaudi::svcLocator()->service("StatusCodeSvc")); 00046 00047 const size_t depth = 21; 00048 void* addresses[depth]; 00049 00050 std::string lib, fnc; 00051 void* addr = 0; 00053 if (System::backTrace(addresses, depth)) { 00054 00055 if (System::getStackLevel(addresses[2], addr, fnc, lib)) { 00056 00057 if (scs) { 00058 scs->regFnc(fnc,lib); 00059 } else { 00060 if (msg) { 00061 MsgStream log(msg,"StatusCode"); 00062 log << MSG::WARNING << "Unchecked in " << fnc << " " << lib << endmsg; 00063 } else { 00064 std::cout << MSG::WARNING << "Unchecked in " << fnc << " " << lib << std::endl; 00065 } 00066 } 00067 00068 } 00069 00070 } 00071 } 00072 } 00073 if (m_severity) delete m_severity; 00074 }
| bool StatusCode::isSuccess | ( | ) | const [inline] |
| 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 status codes. To test for any failure use : if ( !StatusCode.isSuccess() ) ...
Definition at line 62 of file StatusCode.h.
00062 { return !isSuccess(); }
| bool StatusCode::isRecoverable | ( | ) | const [inline] |
Definition at line 63 of file StatusCode.h.
00063 { 00064 m_checked = true; 00065 return (d_code == RECOVERABLE); 00066 }
| unsigned long StatusCode::getCode | ( | ) | const [inline] |
| void StatusCode::setCode | ( | unsigned long | value | ) | [inline] |
| void StatusCode::setChecked | ( | ) | const [inline] |
Ignore the checking code;.
Definition at line 81 of file StatusCode.h.
00081 { 00082 m_checked = true; 00083 }
| void StatusCode::ignore | ( | ) | const [inline] |
| StatusCode::operator unsigned long | ( | ) | const [inline] |
| const IssueSeverity & StatusCode::severity | ( | ) | const |
Severity.
Definition at line 32 of file StatusCode.cpp.
00032 { 00033 static IssueSeverity dummy; 00034 if (m_severity) return *m_severity; 00035 else return dummy; 00036 }
| StatusCode& StatusCode::operator= | ( | unsigned long | value | ) | [inline] |
Assignment operator.
Definition at line 93 of file StatusCode.h.
00093 { 00094 setCode(value); 00095 return *this; 00096 }
| StatusCode& StatusCode::operator= | ( | const StatusCode & | rhs | ) | [inline] |
Definition at line 97 of file StatusCode.h.
00097 { 00098 if (this == &rhs) return *this; // Protection against self-assignment 00099 d_code = rhs.d_code; 00100 m_checked = rhs.m_checked; 00101 rhs.m_checked = true; 00102 if (m_severity) delete m_severity; 00103 m_severity = rhs.m_severity ? cloneSeverity(rhs.m_severity): 0; 00104 return *this; 00105 }
| StatusCode::operator IgnoreError | ( | ) | const [inline] |
Definition at line 118 of file StatusCode.h.
00118 { 00119 m_checked = true; 00120 return IgnoreError(); 00121 }
| void StatusCode::enableChecking | ( | ) | [static] |
| void StatusCode::disableChecking | ( | ) | [static] |
| IssueSeverity * StatusCode::cloneSeverity | ( | const IssueSeverity * | sev | ) | [static, protected] |
Definition at line 26 of file StatusCode.cpp.
00027 { 00028 if( sev ) return new IssueSeverity(*sev); 00029 else return 0; 00030 }
| 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 133 of file StatusCode.h.