|
MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
|
What a getter of a single value returns: the value, or why there is none. More...
#include <MaxMatrixError.h>
Public Member Functions | |
| Result (ValueType value) | |
| Makes a result that holds value. | |
| Result (Error error) | |
| Makes a result that holds why there is no value. | |
| MAXMATRIX_NODISCARD ValueType | GetValue () const |
| Returns the value; 0, or what ValueType() is, after an error. | |
| MAXMATRIX_NODISCARD Error | GetError () const |
| Returns why there is no value, or Error::kOk. | |
| MAXMATRIX_NODISCARD __FlashStringHelper const * | GetErrorText () const |
| Returns the error in a few words, in flash, for Serial.print(). | |
| MAXMATRIX_NODISCARD bool | IsOk () const |
| Returns whether there is a value. | |
Friends | |
| bool | operator== (Result const &result, Error error) |
| Returns whether there is no value for this reason. | |
| bool | operator!= (Result const &result, Error error) |
| Returns whether there is a value, or none for another reason. | |
What a getter of a single value returns: the value, or why there is none.
Instead of the value through a pointer beside a status. After an error the value is 0, or what ValueType() is, never undefined. An array cannot be returned, so GetRow() of the whole panel keeps its parameter and returns a Status.
| ValueType | The type of the value. |
|
inline |
Makes a result that holds value.
Implicit, so that a function returns its value as it is.
| [in] | value | The value. |
|
inline |
Makes a result that holds why there is no value.
Implicit, so that a function returns its error as it is.
| [in] | error | The error. |
|
inline |
Returns the error in a few words, in flash, for Serial.print().
"out of range" for Error::kOutOfRange. Serial.print() reads a __FlashStringHelper from flash, so the text needs no RAM. A sketch that never calls it pays nothing, as the linker drops it with its texts.
|
friend |
Returns whether there is a value, or none for another reason.
| [in] | result | The result of the call. |
| [in] | error | The error to compare with. |
|
friend |
Returns whether there is no value for this reason.
| [in] | result | The result of the call. |
| [in] | error | The error to compare with. |