Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Classes | Public Member Functions | Static Public Member Functions | List of all members
graphar::Status Class Reference

Status outcome object (success or error) More...

#include <status.h>

Public Member Functions

 Status () noexcept
 
 ~Status () noexcept
 
 Status (StatusCode code, const std::string &msg)
 Constructs a status with the specified error code and message. More...
 
 Status (const Status &s)
 
 Status (Status &&s) noexcept
 
Statusoperator= (Status &&s) noexcept
 
constexpr bool ok () const
 
constexpr bool IsKeyError () const
 
constexpr bool IsTypeError () const
 
constexpr bool IsInvalid () const
 
constexpr bool IsIndexError () const
 
constexpr bool IsYamlError () const
 
constexpr bool IsArrowError () const
 
constexpr StatusCode code () const
 
const std::string & message () const
 

Static Public Member Functions

static Status OK ()
 
template<typename... Args>
static Status FromArgs (StatusCode code, Args... args)
 
template<typename... Args>
static Status IOError (Args &&... args)
 
template<typename... Args>
static Status KeyError (Args &&... args)
 
template<typename... Args>
static Status TypeError (Args &&... args)
 
template<typename... Args>
static Status Invalid (Args &&... args)
 
template<typename... Args>
static Status IndexError (Args &&... args)
 
template<typename... Args>
static Status YamlError (Args &&... args)
 
template<typename... Args>
static Status ArrowError (Args &&... args)
 
template<typename... Args>
static Status UnknownError (Args &&... args)
 

Detailed Description

Status outcome object (success or error)

The Status object is an object holding the outcome of an operation. The outcome is represented as a StatusCode, either success (StatusCode::OK) or an error (any other of the StatusCode enumeration values).

Additionally, if an error occurred, a specific error message is generally attached.

Definition at line 123 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/4]

graphar::Status::Status ( )
inlinenoexcept

Create a success status.

Definition at line 126 of file status.h.

◆ ~Status()

graphar::Status::~Status ( )
inlinenoexcept

Destructor.

Definition at line 128 of file status.h.

◆ Status() [2/4]

graphar::Status::Status ( StatusCode  code,
const std::string &  msg 
)
inline

Constructs a status with the specified error code and message.

Parameters
codeThe error code of the status.
msgThe error message of the status.

Definition at line 138 of file status.h.

◆ Status() [3/4]

graphar::Status::Status ( const Status s)
inline

Copy the specified status.

Definition at line 144 of file status.h.

◆ Status() [4/4]

graphar::Status::Status ( Status &&  s)
inlinenoexcept

Move the specified status.

Definition at line 147 of file status.h.

Member Function Documentation

◆ ArrowError()

template<typename... Args>
static Status graphar::Status::ArrowError ( Args &&...  args)
inlinestatic

Return an error status when some arrow-related operation failed.

Definition at line 211 of file status.h.

◆ code()

constexpr StatusCode graphar::Status::code ( ) const
inlineconstexpr

Return the StatusCode value attached to this status.

Definition at line 248 of file status.h.

◆ IndexError()

template<typename... Args>
static Status graphar::Status::IndexError ( Args &&...  args)
inlinestatic

Return an error status when an index is out of bounds.

Definition at line 197 of file status.h.

◆ Invalid()

template<typename... Args>
static Status graphar::Status::Invalid ( Args &&...  args)
inlinestatic

Returns an error status for invalid data (for example a string that fails parsing).

Definition at line 188 of file status.h.

◆ IOError()

template<typename... Args>
static Status graphar::Status::IOError ( Args &&...  args)
inlinestatic

Returns an error status when some IO-related operation failed.

Definition at line 166 of file status.h.

◆ IsArrowError()

constexpr bool graphar::Status::IsArrowError ( ) const
inlineconstexpr

Return true iff the status indicates an arrow-related failure.

Definition at line 243 of file status.h.

◆ IsIndexError()

constexpr bool graphar::Status::IsIndexError ( ) const
inlineconstexpr

Return true iff the status indicates an index out of bounds.

Definition at line 235 of file status.h.

◆ IsInvalid()

constexpr bool graphar::Status::IsInvalid ( ) const
inlineconstexpr

Return true iff the status indicates invalid data.

Definition at line 233 of file status.h.

◆ IsKeyError()

constexpr bool graphar::Status::IsKeyError ( ) const
inlineconstexpr

Return true iff the status indicates a key lookup error.

Definition at line 227 of file status.h.

◆ IsTypeError()

constexpr bool graphar::Status::IsTypeError ( ) const
inlineconstexpr

Return true iff the status indicates a type match error.

Definition at line 229 of file status.h.

◆ IsYamlError()

constexpr bool graphar::Status::IsYamlError ( ) const
inlineconstexpr

Return true iff the status indicates an yaml parse related failure.

Definition at line 239 of file status.h.

◆ KeyError()

template<typename... Args>
static Status graphar::Status::KeyError ( Args &&...  args)
inlinestatic

Returns an error status for failed key lookups.

Definition at line 172 of file status.h.

◆ message()

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

Return the specific error message attached to this status.

Definition at line 253 of file status.h.

◆ OK()

static Status graphar::Status::OK ( )
inlinestatic

Returns a success status.

Definition at line 157 of file status.h.

◆ ok()

constexpr bool graphar::Status::ok ( ) const
inlineconstexpr

Return true iff the status indicates success.

Definition at line 224 of file status.h.

◆ operator=()

Status& graphar::Status::operator= ( Status &&  s)
inlinenoexcept

Move assignment operator.

Definition at line 149 of file status.h.

◆ TypeError()

template<typename... Args>
static Status graphar::Status::TypeError ( Args &&...  args)
inlinestatic

Returns an error status for failed type matches.

Definition at line 178 of file status.h.

◆ UnknownError()

template<typename... Args>
static Status graphar::Status::UnknownError ( Args &&...  args)
inlinestatic

Return an error status for unknown errors.

Definition at line 218 of file status.h.

◆ YamlError()

template<typename... Args>
static Status graphar::Status::YamlError ( Args &&...  args)
inlinestatic

Return an error status when some yaml parse related operation failed.

Definition at line 204 of file status.h.


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