DCMTK
Version 3.6.2
OFFIS DICOM Toolkit
|
OFerror_code is a platform abstracting wrapper for platform specific error codes. More...
Public Member Functions | |
OFerror_code () | |
Default constructor. More... | |
OFerror_code (int code, const OFerror_category &category) | |
Constructs an error code from the given arguments. More... | |
void | assign (int code, const OFerror_category &category) |
Replaces the contents with the given error code and category. More... | |
void | clear () |
Sets the error code to value 0 (success) and the category to OFsystem_category(). | |
int | value () const |
Obtains the actual error code. More... | |
const OFerror_category & | category () const |
Obtains the category linked to this error code. More... | |
OFString | message () const |
Constructs an explanatory string for this error code using the linked error category. More... | |
Private Attributes | |
int | m_Code |
holds the error value. | |
const OFerror_category * | m_Category |
holds the error category | |
OFerror_code is a platform abstracting wrapper for platform specific error codes.
Each OFerror_code object holds an error code originating from the operating system or some low-level interface and a pointer to an object of type OFerror_category, which corresponds to the said interface. The error code values may be not unique across different error categories.
The following table describes the possible operations on two instances a and b of OFerror_code:
Expression | Meaning |
---|---|
if(a), while(a), ... | Test whether the error code refers to an error message or means that everything went fine. OFTrue if the object refers to an error, OFFalse otherwise. |
a != b | Compares two OFerror_code objects, evaluates to OFTrue if both objects refer to a different error code, that is, if either the code or the category (or both) differ, OFFalse otherwise. |
a == b | Compares two OFerror_code objects, evaluates to OFTrue if both objects refer to the same error code, that is, if both the code and the category are equal, OFFalse otherwise. |
a < b | Implements a total order on OFerror_code objects. Will return OFTrue if the category of a compares less than to the category of b. Will return OFFalse if the category of b compares less than to the category of a. If both objects refer to the same category, they will be ordered using the actual error code integer. |
OFerror_code::OFerror_code | ( | ) |
Default constructor.
Initializes an error code with value 0 (success) and category OFsystem_category().
OFerror_code::OFerror_code | ( | int | code, |
const OFerror_category & | category | ||
) |
Constructs an error code from the given arguments.
code | the actual error code. |
category | a reference to the OFerror_category that shall be used. |
void OFerror_code::assign | ( | int | code, |
const OFerror_category & | category | ||
) |
Replaces the contents with the given error code and category.
code | the actual error code. |
category | a reference to the OFerror_category that shall be used. |
const OFerror_category& OFerror_code::category | ( | ) | const |
Obtains the category linked to this error code.
OFString OFerror_code::message | ( | ) | const |
Constructs an explanatory string for this error code using the linked error category.
int OFerror_code::value | ( | ) | const |
Obtains the actual error code.