Lightgraph
C++17 light-graph engine API reference
Loading...
Searching...
No Matches
lightgraph::Status Class Reference

Operation status object. More...

#include <status.hpp>

Public Member Functions

 Status ()=default
 
 Status (ErrorCode code, std::string message)
 
bool ok () const
 True when status code is ErrorCode::Ok.
 
 operator bool () const
 
ErrorCode code () const
 Return the stable error code.
 
const std::string & message () const
 Return the human-readable error message.
 

Static Public Member Functions

static Status success ()
 Construct a success status.
 
static Status error (ErrorCode code, std::string message)
 Construct an error status with code and message.
 

Detailed Description

Operation status object.

Definition at line 30 of file status.hpp.

Constructor & Destructor Documentation

◆ Status() [1/2]

lightgraph::Status::Status ( )
default

Referenced by error(), and success().

◆ Status() [2/2]

lightgraph::Status::Status ( ErrorCode  code,
std::string  message 
)
inline

Definition at line 34 of file status.hpp.

Member Function Documentation

◆ code()

ErrorCode lightgraph::Status::code ( ) const
inline

Return the stable error code.

Definition at line 58 of file status.hpp.

Referenced by error().

◆ error()

static Status lightgraph::Status::error ( ErrorCode  code,
std::string  message 
)
inlinestatic

Construct an error status with code and message.

Definition at line 44 of file status.hpp.

References code(), message(), and Status().

Referenced by lightgraph::Result< T >::error().

◆ message()

const std::string & lightgraph::Status::message ( ) const
inline

Return the human-readable error message.

Definition at line 63 of file status.hpp.

Referenced by error().

◆ ok()

bool lightgraph::Status::ok ( ) const
inline

True when status code is ErrorCode::Ok.

Definition at line 51 of file status.hpp.

References lightgraph::Ok.

Referenced by lightgraph::Result< T >::ok(), and operator bool().

◆ operator bool()

lightgraph::Status::operator bool ( ) const
inlineexplicit

Definition at line 53 of file status.hpp.

References ok().

◆ success()

static Status lightgraph::Status::success ( )
inlinestatic

Construct a success status.

Definition at line 39 of file status.hpp.

References Status().


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