|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
#include <GaudiKernel/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 () |
Protected Types | |
| typedef boost::shared_ptr < IssueSeverity > | SeverityPtr |
Protected Attributes | |
| unsigned long | d_code |
| The status code. | |
| bool | m_checked |
| If the Status code has been checked. | |
| SeverityPtr | 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. | |
Definition at line 26 of file StatusCode.h.
typedef boost::shared_ptr<IssueSeverity> StatusCode::SeverityPtr [protected] |
Definition at line 136 of file StatusCode.h.
| anonymous enum |
Definition at line 28 of file StatusCode.h.
00028 { 00029 FAILURE = 0, 00030 SUCCESS = 1, 00031 RECOVERABLE = 2 00032 };
| StatusCode::StatusCode | ( | ) | [inline] |
Constructor.
Definition at line 35 of file StatusCode.h.
00035 : 00036 d_code(SUCCESS), m_checked(false), m_severity() {} StatusCode( unsigned long code, const IssueSeverity& sev ):
| StatusCode::StatusCode | ( | unsigned long | code, | |
| const IssueSeverity & | sev | |||
| ) | [inline] |
Definition at line 37 of file StatusCode.h.
00037 : 00038 d_code(code),m_checked(false), m_severity() { 00039 try { // ensure that we do not throw even if the we cannot copy the severity 00040 m_severity = SeverityPtr(new IssueSeverity(sev)); 00041 } 00042 catch (...) {} 00043 } StatusCode( unsigned long code, bool checked = false ):
Definition at line 44 of file StatusCode.h.
00044 : 00045 d_code(code),m_checked(checked), m_severity() {}
| StatusCode::StatusCode | ( | const StatusCode & | rhs | ) | [inline] |
Definition at line 47 of file StatusCode.h.
00047 : 00048 d_code(rhs.d_code), m_checked(rhs.m_checked), 00049 m_severity(rhs.m_severity) 00050 { rhs.m_checked = true; }
| StatusCode::~StatusCode | ( | ) |
Destructor.
: (MCl) use backTrace(std::string&, const int, const int) instead
Definition at line 32 of file StatusCode.cpp.
00032 { 00033 if(s_checking) { 00034 00035 if (!m_checked ) { 00036 00037 SmartIF<IMessageSvc> msg(Gaudi::svcLocator()); 00038 00039 SmartIF<IStatusCodeSvc> scs(Gaudi::svcLocator()->service("StatusCodeSvc")); 00040 00041 const size_t depth = 21; 00042 void* addresses[depth]; 00043 00044 std::string lib, fnc; 00045 void* addr = 0; 00047 if (System::backTrace(addresses, depth)) { 00048 00049 if (System::getStackLevel(addresses[2], addr, fnc, lib)) { 00050 00051 if (scs) { 00052 scs->regFnc(fnc,lib); 00053 } else { 00054 if (msg) { 00055 MsgStream log(msg,"StatusCode"); 00056 log << MSG::WARNING << "Unchecked in " << fnc << " " << lib << endmsg; 00057 } else { 00058 std::cout << MSG::WARNING << "Unchecked in " << fnc << " " << lib << std::endl; 00059 } 00060 } 00061 00062 } 00063 00064 } 00065 } 00066 } 00067 }
| 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 68 of file StatusCode.h.
00068 { return !isSuccess(); }
| bool StatusCode::isRecoverable | ( | ) | const [inline] |
Definition at line 69 of file StatusCode.h.
00069 { 00070 m_checked = true; 00071 return (d_code == RECOVERABLE); 00072 }
| 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 87 of file StatusCode.h.
00087 { 00088 m_checked = true; 00089 }
| void StatusCode::ignore | ( | ) | const [inline] |
| StatusCode::operator unsigned long | ( | ) | const [inline] |
| const IssueSeverity & StatusCode::severity | ( | ) | const |
Severity.
Definition at line 26 of file StatusCode.cpp.
00026 { 00027 static IssueSeverity dummy; 00028 if (m_severity) return *m_severity; 00029 else return dummy; 00030 }
| StatusCode& StatusCode::operator= | ( | unsigned long | value | ) | [inline] |
| StatusCode& StatusCode::operator= | ( | const StatusCode & | rhs | ) | [inline] |
Definition at line 103 of file StatusCode.h.
00103 { 00104 if (this == &rhs) return *this; // Protection against self-assignment 00105 d_code = rhs.d_code; 00106 m_checked = rhs.m_checked; 00107 rhs.m_checked = true; 00108 m_severity = rhs.m_severity; 00109 return *this; 00110 }
| StatusCode::operator IgnoreError | ( | ) | const [inline] |
Definition at line 123 of file StatusCode.h.
00123 { 00124 m_checked = true; 00125 return IgnoreError(); 00126 }
| void StatusCode::enableChecking | ( | ) | [static] |
| void StatusCode::disableChecking | ( | ) | [static] |
| 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] |
SeverityPtr StatusCode::m_severity [protected] |
bool StatusCode::s_checking [static, protected] |
Global flag to control if StatusCode need to be checked.
Definition at line 139 of file StatusCode.h.