Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
database::async::result_type< T > Class Template Reference

Fallback Result<T> implementation. More...

#include <thread_pool_adapter.h>

Collaboration diagram for database::async::result_type< T >:
Collaboration graph

Public Member Functions

 result_type (T &&value)
 
 result_type (const T &value)
 
 result_type (const std::string &error)
 
bool is_ok () const
 
bool has_error () const
 
const T & value () const
 
T & value ()
 
const std::string & error () const
 

Private Attributes

value_
 
std::string error_
 
bool has_value_
 

Detailed Description

template<typename T>
class database::async::result_type< T >

Fallback Result<T> implementation.

Definition at line 176 of file thread_pool_adapter.h.

Constructor & Destructor Documentation

◆ result_type() [1/3]

template<typename T >
database::async::result_type< T >::result_type ( T && value)
inline

◆ result_type() [2/3]

template<typename T >
database::async::result_type< T >::result_type ( const T & value)
inline

Definition at line 179 of file thread_pool_adapter.h.

179: value_(value), has_value_(true) {}

◆ result_type() [3/3]

template<typename T >
database::async::result_type< T >::result_type ( const std::string & error)
inline

Definition at line 180 of file thread_pool_adapter.h.

180: error_(error), has_value_(false) {}
const std::string & error() const

Member Function Documentation

◆ error()

template<typename T >
const std::string & database::async::result_type< T >::error ( ) const
inline

Definition at line 188 of file thread_pool_adapter.h.

188{ return error_; }

References database::async::result_type< T >::error_.

◆ has_error()

template<typename T >
bool database::async::result_type< T >::has_error ( ) const
inline

Definition at line 183 of file thread_pool_adapter.h.

183{ return !has_value_; }

References database::async::result_type< T >::has_value_.

◆ is_ok()

template<typename T >
bool database::async::result_type< T >::is_ok ( ) const
inline

Definition at line 182 of file thread_pool_adapter.h.

182{ return has_value_; }

References database::async::result_type< T >::has_value_.

◆ value() [1/2]

template<typename T >
T & database::async::result_type< T >::value ( )
inline

Definition at line 186 of file thread_pool_adapter.h.

186{ return value_; }

References database::async::result_type< T >::value_.

◆ value() [2/2]

template<typename T >
const T & database::async::result_type< T >::value ( ) const
inline

Definition at line 185 of file thread_pool_adapter.h.

185{ return value_; }

References database::async::result_type< T >::value_.

Member Data Documentation

◆ error_

template<typename T >
std::string database::async::result_type< T >::error_
private

Definition at line 192 of file thread_pool_adapter.h.

Referenced by database::async::result_type< T >::error().

◆ has_value_

template<typename T >
bool database::async::result_type< T >::has_value_
private

◆ value_

template<typename T >
T database::async::result_type< T >::value_
private

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