ReturnCode

class eduponz::easynmea::ReturnCode

Provides understandable return codes for the different operations that the library performs.

These return codes can be easily compared for applications to handle different scenarios.

Public Types

enum [anonymous]

Internal ReturnCode enumeration.

Values:

enumerator RETURN_CODE_OK = 0

Operation succeeded.

enumerator RETURN_CODE_NO_DATA = 1

No data available.

enumerator RETURN_CODE_TIMEOUT = 2

Operation timed out.

enumerator RETURN_CODE_BAD_PARAMETER = 3

Bad input parameter to function call.

enumerator RETURN_CODE_ILLEGAL_OPERATION = 4

The operation is illegal.

enumerator RETURN_CODE_UNSUPPORTED = 5

The operation is not yet supported.

enumerator RETURN_CODE_ERROR = 6

The operation failed with an unexpected error.

Public Functions

ReturnCode()

Default constructor; construct a ReturnCode with value ReturnCode::RETURN_CODE_OK.

ReturnCode(uint32_t e)

Construct a return code from an integer representing the enum value.

bool operator==(const ReturnCode &c) const

Check whether a return code is equal to this one

Return

true if equal; false otherwise

Parameters
  • [in] c: A constant reference to the return code to compare with this one

bool operator!=(const ReturnCode &c) const

Check whether a return code is different from this one

Return

true if not equal; false otherwise

Parameters
  • [in] c: A constant reference to the return code to compare with this one

uint32_t operator()() const

Get the internal value of the ReturnCode

Return

This ReturnCode internal value

bool operator!() const

Check whether this ReturnCode is equal to ReturnCode::RETURN_CODE_OK

Return

true if this ReturnCode is different than ReturnCode::RETURN_CODE_OK ; false otherwise