Contains information about a specific result value. Can be compared against another Result structure. Can also be printed as text for better debugging experience.
More...
#include <result.h>
|
DIARKIS_EXPORT friend std::ostream & | operator<< (std::ostream &os, const Result &result) |
| Allows printing a full string representation of the result value, via C++ string stream mechanism. More...
|
|
Contains information about a specific result value. Can be compared against another Result structure. Can also be printed as text for better debugging experience.
◆ Result() [1/2]
Diarkis::System::Result::Result |
( |
| ) |
|
|
explicitnoexcept |
Constructs an unset Result structure.
◆ Result() [2/2]
Diarkis::System::Result::Result |
( |
uint32_t |
uid, |
|
|
bool |
isAlias = false |
|
) |
| |
|
explicit |
Constructs a properly set Result structure.
- Parameters
-
◆ operator uint32_t()
Diarkis::System::Result::operator uint32_t |
( |
| ) |
const |
|
explicit |
Cast the result structure to a numeric value.
- Returns
- uint32_t unsigned 32-bits numeric value representation of the result.
◆ operator==() [1/2]
bool Diarkis::System::Result::operator== |
( |
const Result & |
other | ) |
const |
Checks whether this result is the same as the other.
- Parameters
-
other | The other result to check equality upon. |
- Returns
- true when both are equal.
-
false when both are different.
◆ operator!=() [1/2]
bool Diarkis::System::Result::operator!= |
( |
const Result & |
other | ) |
const |
Checks whether this result is different from the other.
- Parameters
-
other | The other result value to check inequality upon. |
- Returns
- true when both are different.
-
false when both are equal.
◆ operator==() [2/2]
bool Diarkis::System::Result::operator== |
( |
const uint32_t |
other | ) |
const |
Checks whether the numeric representation of the result is the same as the other.
- Parameters
-
other | The other result to check equality upon. |
- Returns
- true when both are equal.
-
false when both are different.
◆ operator!=() [2/2]
bool Diarkis::System::Result::operator!= |
( |
const uint32_t |
other | ) |
const |
Checks whether the numeric representation of the result is differnt from the other.
- Parameters
-
other | The other result value to check inequality upon. |
- Returns
- true when both are different.
-
false when both are equal.
◆ ToString()
Provides a string represenation of the result value. Produces the same output as << operator.
- Returns
- Diarkis::StdString A string represenation of the result value.
◆ Reset()
void Diarkis::System::Result::Reset |
( |
| ) |
|
Reset the result to is default unset value.
◆ GetVariableName()
const char* Diarkis::System::Result::GetVariableName |
( |
| ) |
const |
Gets the variable name as defined in the source code.
- Returns
- const char* the variable name as defined in the source code.
◆ GetFullyQualifiedVariableName()
const char* Diarkis::System::Result::GetFullyQualifiedVariableName |
( |
| ) |
const |
Gets the fully qualified variable name (prefixed with namespace) as defined in the source code.
- Returns
- const char* the fully qualified variable name (prefixed with namespace) as defined in the source code.
◆ GetDescription()
const char* Diarkis::System::Result::GetDescription |
( |
| ) |
const |
Gets a longer and more descriptive message related to the result value.
- Returns
- const char* a longer and more descriptive message related to the result value.
◆ GetStatus()
Gets the status of the result value.
- Returns
- ResultStatus the status of the result value.
◆ GetStatusString()
const char* Diarkis::System::Result::GetStatusString |
( |
| ) |
const |
Gets a string representation of the status of the result value.
- Returns
- const char* a string representation of the status of the result value.
◆ IsTemporary()
bool Diarkis::System::Result::IsTemporary |
( |
| ) |
const |
Checks whether a result value is temporary (status is TEMPORARY).
- Returns
- true when the status is TEMPORARY.
-
false when the status is not TEMPORARY.
◆ IsFatal()
bool Diarkis::System::Result::IsFatal |
( |
| ) |
const |
Checks whether a result value is fatal (status is FATAL).
- Returns
- true when the status is FATAL.
-
false when the status is not FATAL.
◆ MatchAny()
bool Diarkis::System::Result::MatchAny |
( |
std::initializer_list< Result > |
args | ) |
|
Checks whether the current result matches any of the results passed as arguments.
- Parameters
-
args | All the results to check for a match. Use syntax { RESULT1, RESULT2, RESULT3 }. |
- Returns
- true when the current result matches any of the results passed as arguments.
-
false when the current result does not match any of the results passed as arguments.
◆ operator<<
DIARKIS_EXPORT friend std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Result & |
result |
|
) |
| |
|
friend |
Allows printing a full string representation of the result value, via C++ string stream mechanism.
- Parameters
-
os | Chained output stream. |
result | The result value to stream the string representation. |
- Returns
- std::ostream& the passed in output strean, for chaining purpose.
The documentation for this struct was generated from the following file:
- client/cpp/libDiarkis/include/diarkis/system/result.h