ATLAS Offline Software
|
#include <StorageSvc/DbStatus.h>
Public Types | |
enum | ErrorLevel { Success = 1, Info = (1u<<30), Warning = (1u<<31), Error = (1u<<31) + (1u<<30) } |
Public Member Functions | |
DbStatus () | |
Standard Constructor. Defaults to Error. More... | |
DbStatus (const DbStatus &)=default | |
Default copy constructor. More... | |
DbStatus & | operator= (const DbStatus &)=default |
DbStatus (unsigned int code) | |
Standard constructor with initialization from long value. More... | |
DbStatus (ErrorLevel lvl, unsigned int fac, unsigned int code) | |
Constructor with initialization from Error level, facility and code. More... | |
~DbStatus ()=default | |
Default destructor. Non virtual for performance reasons. Do NOT inherit. More... | |
operator unsigned int () const | |
Cast operator. More... | |
DbStatus & | operator= (unsigned int value) |
Assignment operator. More... | |
unsigned int | severity () const |
Access severity code. More... | |
unsigned int | facility () const |
Access facility code. More... | |
unsigned int | code () const |
Access error code value. More... | |
unsigned int | reserved () const |
Access the reserved bits. More... | |
unsigned int | value () const |
Acces fully encoded value. More... | |
bool | isSuccess () const |
Check if the return code indicated success. More... | |
bool | isInfo () const |
Check if the return code indicated an informational message. More... | |
bool | isWarning () const |
Check if the return code indicated a warning. More... | |
bool | isError () const |
Check if the return code indicated an error. More... | |
Static Public Member Functions | |
static unsigned int | success () |
Access bit mask field for Success messages. More... | |
static unsigned int | info () |
Access bit mask field for Informational messages. More... | |
static unsigned int | warning () |
Access bit mask field for Warning messages. More... | |
static unsigned int | error () |
Access bit mask field for Error messages. More... | |
Private Attributes | |
unsigned int | m_code |
Friends | |
bool | operator< (const DbStatus &a, const DbStatus &b) |
Comparison operator lesser. More... | |
bool | operator> (const DbStatus &a, const DbStatus &b) |
Comparison operator greater. More... | |
This class is highly inspired by the error code distribution system as it is used in DEC/VMS or MS/WNT.
Values are 32 bit values layed out as follows:
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +—+-+-+--------------------—+----------------------------—+ |Sev|C|R| Facility | Code | +—+-+-+--------------------—+----------------------------—+
where
Sev - is the severity code 00 - Success 01 - Informational 10 - Warning 11 - Error C - is a customer bit (currently not used) R - is a reserved bit Facility - is the facility code Code - is the facility's DbStatus code
Additionally Success message codes must have the low bit set. e.g. 0xC0000001 is Success 0xD0000000 is Informational 0xE0000000 is Warning 0xF0000000 is Error
however, 0xF0000001, 0xE000001, 0xD0000001 or 0xC0000001 are not allowed.
Definition at line 67 of file DbStatus.h.
|
inline |
Standard Constructor. Defaults to Error.
Definition at line 79 of file DbStatus.h.
|
inline |
Standard constructor with initialization from long value.
Definition at line 84 of file DbStatus.h.
|
inline |
Constructor with initialization from Error level, facility and code.
Definition at line 127 of file DbStatus.h.
|
default |
Default destructor. Non virtual for performance reasons. Do NOT inherit.
|
inline |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
Check if the return code indicated an informational message.
Definition at line 106 of file DbStatus.h.
|
inline |
Check if the return code indicated success.
Definition at line 104 of file DbStatus.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inlinestatic |
Comparison operator lesser.
Definition at line 129 of file DbStatus.h.
Comparison operator greater.
Definition at line 131 of file DbStatus.h.
|
private |
Definition at line 69 of file DbStatus.h.