Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ersa::Result< void > Class Reference

#include <types.h>

Collaboration diagram for ersa::Result< void >:
Collaboration graph
[legend]

Public Member Functions

 Result ()
 
 Result (const Error &err)
 
 Result (ErrorCode code, const char *msg="")
 
bool isOk () const
 
bool isError () const
 
const Error & error () const
 

Private Attributes

Error error_ {ErrorCode::Ok}
 

Detailed Description

No-payload specialization for operations that report success or failure only.

Constructor & Destructor Documentation

◆ Result() [1/3]

ersa::Result< void >::Result ( )
inline

Construct a successful no-payload result.

◆ Result() [2/3]

ersa::Result< void >::Result ( const Error &  err)
inline

Construct a failed no-payload result from an Error value.

◆ Result() [3/3]

ersa::Result< void >::Result ( ErrorCode  code,
const char *  msg = "" 
)
inline

Construct a failed no-payload result from a code and diagnostic.

Member Function Documentation

◆ error()

const Error & ersa::Result< void >::error ( ) const
inline

Inspect the outcome code and diagnostic.

◆ isError()

bool ersa::Result< void >::isError ( ) const
inline

Test whether the operation completed with an error.

◆ isOk()

bool ersa::Result< void >::isOk ( ) const
inline

Test whether the operation completed successfully.

Member Data Documentation

◆ error_

Error ersa::Result< void >::error_ {ErrorCode::Ok}
private

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