Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvResult Class Reference

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 PvResultoperator|= (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...
 

Detailed Description

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:

  • Some methods return immediately, but the ultimate success of the method may not be know for some time after (several seconds or more). These methods return PvResult::Code::PENDING. Pending operations are considered successful.

To use result codes (best coding practices):

  1. Call a method.
  2. Test the result for success. Use IsSuccess, IsOK, or test against specific PvResult::Code values.

Constructor & Destructor Documentation

◆ PvResult() [1/5]

PvResult::PvResult ( uint32_t  aCode)

Constructor intializing the object to a specific status code.

Parameters
[in]aCodeCode to assign to the PvResult object on construction.

◆ PvResult() [2/5]

PvResult::PvResult ( uint32_t  aCode,
uint32_t  aOSCode 
)

Constructor intializing the object to a specific status code and OS code.

Parameters
[in]aCodeCode to assign to the PvResult object on construction.
[in]aOSCodeOS code to assign to the PvResult object on construction.

◆ PvResult() [3/5]

PvResult::PvResult ( uint32_t  aCode,
const PvString aDescription 
)

Constructor initializing the object to a specific status code and description.

Parameters
[in]aCodeCode to assign to the PvResult object on construction.
[in]aDescriptionDescription to assign to the PvResult object on construction.

◆ PvResult() [4/5]

PvResult::PvResult ( uint32_t  aCode,
uint32_t  aOSCode,
const PvString aDescription 
)

Constructor initializing the object to a specific status code, OS code and description.

Parameters
[in]aCodeCode to assign to the PvResult object on construction.
[in]aOSCodeOS code to assign to the PvResult object on construction.
[in]aDescriptionDescription to assign to the PvResult object on construction.

◆ PvResult() [5/5]

PvResult::PvResult ( const PvResult aResult)

Copy constructor.

Parameters
[in]aResultPvResult used to call the copy constructor.

Member Function Documentation

◆ GetCode()

uint32_t PvResult::GetCode ( ) const

Get the result code.

Returns
The result code.

◆ GetCodeString()

PvString PvResult::GetCodeString ( ) const

Get the result code in the form of a string.

Returns
A string that is the direct translation of the result code.

◆ GetDescription()

PvString PvResult::GetDescription ( ) const

Get the result description.

Returns
A string that provides human-readable information about the result.

◆ GetInternalCode()

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.

Returns
Internal error code.

◆ GetOSCode()

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.

Returns
Internal OS code.

◆ HasDescription()

bool PvResult::HasDescription ( ) const

Returns true if the result has a valid description that can be retrieved with PvResult::GetDescription.

Returns
True if the result has a valid description.

◆ IsFailure()

bool PvResult::IsFailure ( ) const

Test for a failed result.

Returns
True if the result is other than PvResult::Code::OK or PvResult::Code::PENDING; otherwise, false.

◆ IsOK()

bool PvResult::IsOK ( ) const

Test for a successful result.

Returns
True if the result is PvResult::Code::OK; otherwise, false.

◆ IsPending()

bool PvResult::IsPending ( ) const

Test for a pending result.

Returns
True if the result is PvResult::Code::PENDING; otherwise, false.

◆ IsSuccess()

bool PvResult::IsSuccess ( ) const

Test for a successful result.

Methods for testing result codes include:

Returns
True if the result is PvResult::Code::OK or PvResult::Code::PENDING; otherwise, false.

◆ operator!=() [1/2]

bool PvResult::operator!= ( const PvResult aB) const

Inequality operator, works on PvResult objects.

Parameters
[in]aB
Returns
True if the result codes aren't equal; otherwise, false.

◆ operator!=() [2/2]

bool PvResult::operator!= ( const uint32_t  aCode) const

Inequality operator, works on this PvResult and aCode.

Parameters
[in]aCodeThe result code.
Returns
True if the result codes aren't equal; otherwise, false.

◆ operator==() [1/2]

bool PvResult::operator== ( const PvResult aB) const

Equality operator. Returns true if both PvResult objects contain the same code.

Parameters
[in]aB
Returns
True if the result codes are equal; otherwise, false.

◆ operator==() [2/2]

bool PvResult::operator== ( const uint32_t  aCode) const

Equality operator. Returns true if this PvResult contains aCode.

Parameters
[in]aCode
Returns
True if the result codes are equal; otherwise, false.

◆ operator|=()

const PvResult & PvResult::operator|= ( const PvResult aB)

Or-equal operator.

Parameters
[in]aBoperand.
Returns
The result of this PvResult or-ed with aB.

◆ SetCode()

void PvResult::SetCode ( uint32_t  aIn)

Assigns a specific error code to this PvResult.

Parameters
[in]aIn

◆ SetDescription()

void PvResult::SetDescription ( const PvString aDescription)

Assigns a specific description to this PvResult.

Parameters
[in]aDescriptionSets a description for the result.

The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com