Lunchbox  1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::Result Class Reference

A result returns an error code and behaves like a boolean. More...

#include <result.h>

+ Collaboration diagram for lunchbox::Result:

Public Member Functions

 Result (const int32_t code)
 Construct a new result. More...
 
virtual ~Result ()
 Destruct the result. More...
 
 operator bool_t () const
 
bool operator! () const
 
bool operator== (const int32_t code) const
 
bool operator!= (const int32_t code) const
 
int32_t getCode () const
 
virtual std::string getString () const
 

Static Public Attributes

static const int32_t SUCCESS = 0
 

Protected Attributes

int32_t code_
 

Detailed Description

A result returns an error code and behaves like a boolean.

Definition at line 30 of file result.h.

Constructor & Destructor Documentation

lunchbox::Result::Result ( const int32_t  code)
inlineexplicit

Construct a new result.

Version
1.9.1

Definition at line 38 of file result.h.

virtual lunchbox::Result::~Result ( )
inlinevirtual

Destruct the result.

Version
1.9.1

Definition at line 44 of file result.h.

Member Function Documentation

int32_t lunchbox::Result::getCode ( ) const
inline
Returns
the result code.
Version
1.9.1

Definition at line 58 of file result.h.

Referenced by getString().

+ Here is the caller graph for this function:

virtual std::string lunchbox::Result::getString ( ) const
inlinevirtual
Returns
the result string.
Version
1.9.1

Definition at line 60 of file result.h.

References getCode(), getString(), and lunchbox::operator<<().

Referenced by getString().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lunchbox::Result::operator bool_t ( ) const
inline
Returns
true if no error occured, false otherwise.
Version
1.9.1

Definition at line 46 of file result.h.

bool lunchbox::Result::operator! ( ) const
inline
Returns
true if an error occured, false otherwise.
Version
1.9.1

Definition at line 52 of file result.h.

bool lunchbox::Result::operator!= ( const int32_t  code) const
inline
Returns
true if the result is not equal to the rhs.
Version
1.9.1

Definition at line 56 of file result.h.

bool lunchbox::Result::operator== ( const int32_t  code) const
inline
Returns
true if the result is equal to the given value.
Version
1.9.1

Definition at line 54 of file result.h.


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