Very Simple Cross-Platform Library
|
#include <Failable.h>
Public Member Functions | |
Failable () | |
bool | failed () const |
errorCode_t | getErrorCode () const |
void | repair () |
Protected Member Functions | |
void | setErrorCode (errorCode_t ec) |
Private Attributes | |
errorCode_t | errorCode |
An object whose instances can fail, and the reason of the failure is indicated by an integral error code.
Definition at line 45 of file Failable.h.
|
inline |
Construct the object and initialize the error code to indicate no error.
Definition at line 115 of file Failable.h.
|
inline |
Indicate if the object has failed.
Definition at line 122 of file Failable.h.
|
inline |
Get the error code.
Definition at line 129 of file Failable.h.
|
inline |
Discard the error code.
Definition at line 136 of file Failable.h.
|
inlineprotected |
Set the error code.
Definition at line 143 of file Failable.h.
|
private |
The error code.
Definition at line 51 of file Failable.h.