Result information. More...
Classes | |
struct | Code |
Public Member Functions | |
PvResult () | |
Constructor. | |
PvResult (uint32_t aCode) | |
Constructor intializing the object to a specific status code. More... | |
PvResult (uint32_t aCode, uint32_t aOSCode) | |
Constructor intializing the object to a specific status code and OS code. More... | |
PvResult (uint32_t aCode, const PvString &aDescription) | |
Constructor initializing the object to a specific status code and description. More... | |
PvResult (uint32_t aCode, uint32_t aOSCode, const PvString &aDescription) | |
Constructor initializing the object to a specific status code, OS code and description. More... | |
PvResult (const PvResult &aResult) | |
Copy constructor. More... | |
~PvResult () | |
Destructor. | |
operator const char * () const | |
Casts the PvResult into a const char pointer, returning a string representation of the PvResult. | |
bool | operator== (const PvResult &aB) const |
Equality operator. Returns true if both PvResult objects contain the same code. More... | |
bool | operator== (const uint32_t aCode) const |
Equality operator. Returns true if this PvResult contains aCode. More... | |
bool | operator!= (const PvResult &aB) const |
Inequality operator, works on PvResult objects. More... | |
bool | operator!= (const uint32_t aCode) const |
Inequality operator, works on this PvResult and aCode. More... | |
const PvResult & | operator|= (const PvResult &aB) |
Or-equal operator. More... | |
void | SetCode (uint32_t aIn) |
Assigns a specific error code to this PvResult. More... | |
uint32_t | GetCode () const |
Get the result code. More... | |
PvString | GetCodeString () const |
Get the result code in the form of a string. More... | |
PvString | GetDescription () const |
Get the result description. More... | |
void | SetDescription (const PvString &aDescription) |
Assigns a specific description to this PvResult. More... | |
bool | HasDescription () const |
Returns true if the result has a valid description that can be retrieved with PvResult::GetDescription. More... | |
bool | IsFailure () const |
Test for a failed result. More... | |
bool | IsOK () const |
Test for a successful result. More... | |
bool | IsPending () const |
Test for a pending result. More... | |
bool | IsSuccess () const |
Test for a successful result. More... | |
uint32_t | GetInternalCode () const |
Returns the internal error code of the error. More... | |
uint32_t | GetOSCode () const |
Retrieves the internal OS code that may have triggered the error. More... | |
Result information.
The PvResult class provides information about the success or failure of the methods you use.
Most successful methods return PvResult::Code::OK, however, there are exceptions:
To use result codes (best coding practices):
PvResult::PvResult | ( | uint32_t | aCode | ) |
PvResult::PvResult | ( | uint32_t | aCode, |
uint32_t | aOSCode | ||
) |
PvResult::PvResult | ( | uint32_t | aCode, |
const PvString & | aDescription | ||
) |
PvResult::PvResult | ( | uint32_t | aCode, |
uint32_t | aOSCode, | ||
const PvString & | aDescription | ||
) |
Constructor initializing the object to a specific status code, OS code and description.
PvResult::PvResult | ( | const PvResult & | aResult | ) |
Copy constructor.
[in] | aResult | PvResult used to call the copy constructor. |
uint32_t PvResult::GetCode | ( | ) | const |
Get the result code.
PvString PvResult::GetCodeString | ( | ) | const |
Get the result code in the form of a string.
PvString PvResult::GetDescription | ( | ) | const |
Get the result description.
uint32_t PvResult::GetInternalCode | ( | ) | const |
Returns the internal error code of the error.
This method can be used to retrieve the internal error code that was mapped to the public error code contained in the PvResult.
The user is not expected to be able to interpret this error code. It can be used in order to provide more information to Pleora support personnel.
uint32_t PvResult::GetOSCode | ( | ) | const |
Retrieves the internal OS code that may have triggered the error.
The user is not expected to be able to interpret this error code, it can widely vary based on the platform or even API that generated it. It can be used in order to provide more information to Pleora support personnel.
bool PvResult::HasDescription | ( | ) | const |
Returns true if the result has a valid description that can be retrieved with PvResult::GetDescription.
bool PvResult::IsFailure | ( | ) | const |
Test for a failed result.
bool PvResult::IsOK | ( | ) | const |
Test for a successful result.
bool PvResult::IsPending | ( | ) | const |
Test for a pending result.
bool PvResult::IsSuccess | ( | ) | const |
Test for a successful result.
Methods for testing result codes include:
bool PvResult::operator!= | ( | const PvResult & | aB | ) | const |
Inequality operator, works on PvResult objects.
[in] | aB |
bool PvResult::operator!= | ( | const uint32_t | aCode | ) | const |
Inequality operator, works on this PvResult and aCode.
[in] | aCode | The result code. |
bool PvResult::operator== | ( | const PvResult & | aB | ) | const |
Equality operator. Returns true if both PvResult objects contain the same code.
[in] | aB |
bool PvResult::operator== | ( | const uint32_t | aCode | ) | const |
Equality operator. Returns true if this PvResult contains aCode.
[in] | aCode |
void PvResult::SetCode | ( | uint32_t | aIn | ) |
Assigns a specific error code to this PvResult.
[in] | aIn |
void PvResult::SetDescription | ( | const PvString & | aDescription | ) |
Assigns a specific description to this PvResult.
[in] | aDescription | Sets a description for the result. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com