Diarkis C++Client Library API Document
Diarkis::System::Result Struct Reference

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>

Public Member Functions

 Result () noexcept
 Constructs an unset Result structure. More...
 
 Result (uint32_t uid, bool isAlias=false)
 Constructs a properly set Result structure. More...
 
 operator uint32_t () const
 Cast the result structure to a numeric value. More...
 
bool operator== (const Result &other) const
 Checks whether this result is the same as the other. More...
 
bool operator!= (const Result &other) const
 Checks whether this result is different from the other. More...
 
bool operator== (const uint32_t other) const
 Checks whether the numeric representation of the result is the same as the other. More...
 
bool operator!= (const uint32_t other) const
 Checks whether the numeric representation of the result is differnt from the other. More...
 
Diarkis::StdString ToString () const
 Provides a string represenation of the result value. Produces the same output as << operator. More...
 
void Reset ()
 Reset the result to is default unset value. More...
 
const char * GetVariableName () const
 Gets the variable name as defined in the source code. More...
 
const char * GetFullyQualifiedVariableName () const
 Gets the fully qualified variable name (prefixed with namespace) as defined in the source code. More...
 
const char * GetDescription () const
 Gets a longer and more descriptive message related to the result value. More...
 
ResultStatus GetStatus () const
 Gets the status of the result value. More...
 
const char * GetStatusString () const
 Gets a string representation of the status of the result value. More...
 
bool IsTemporary () const
 Checks whether a result value is temporary (status is TEMPORARY). More...
 
bool IsFatal () const
 Checks whether a result value is fatal (status is FATAL). More...
 
bool MatchAny (std::initializer_list< Result > args)
 Checks whether the current result matches any of the results passed as arguments. More...
 

Friends

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...
 

Detailed Description

Contains information about a specific result value. Can be compared against another Result structure. Can also be printed as text for better debugging experience.

Constructor & Destructor Documentation

◆ 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
uid
isAlias

Member Function Documentation

◆ 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
otherThe 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
otherThe 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
otherThe 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
otherThe other result value to check inequality upon.
Returns
true when both are different.
false when both are equal.

◆ ToString()

Diarkis::StdString Diarkis::System::Result::ToString ( ) const

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.
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ GetStatus()

ResultStatus Diarkis::System::Result::GetStatus ( ) const

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.
Here is the caller graph for this function:

◆ 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
argsAll 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.

Friends And Related Function Documentation

◆ 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
osChained output stream.
resultThe 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: