libcopp  2.2.0
Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
future::result_base< TOK, TERR, false > Class Template Reference

#include <storage.h>

Collaboration diagram for future::result_base< TOK, TERR, false >:
Collaboration graph

Public Types

enum  mode_type { EN_RESULT_SUCCESS = 0 , EN_RESULT_ERROR = 1 , EN_RESULT_NONE = 2 }
 
using success_type = TOK
 
using error_type = TERR
 

Public Member Functions

UTIL_FORCEINLINE bool is_success () const LIBCOPP_MACRO_NOEXCEPT
 
UTIL_FORCEINLINE bool is_error () const LIBCOPP_MACRO_NOEXCEPT
 
UTIL_FORCEINLINE const success_typeget_success () const LIBCOPP_MACRO_NOEXCEPT
 
UTIL_FORCEINLINE success_typeget_success () LIBCOPP_MACRO_NOEXCEPT
 
UTIL_FORCEINLINE const error_typeget_error () const LIBCOPP_MACRO_NOEXCEPT
 
UTIL_FORCEINLINE error_typeget_error () LIBCOPP_MACRO_NOEXCEPT
 
 result_base ()
 
 ~result_base ()
 
 result_base (result_base &&other)
 
result_baseoperator= (result_base &&other)
 
UTIL_FORCEINLINE void swap (result_base &other) LIBCOPP_MACRO_NOEXCEPT
 

Private Types

using success_storage_type = typename default_compact_storage< success_type >::type
 
using error_storage_type = typename default_compact_storage< error_type >::type
 

Private Member Functions

template<class... TARGS>
UTIL_FORCEINLINE void construct_success (TARGS &&...args)
 
template<class... TARGS>
UTIL_FORCEINLINE void construct_error (TARGS &&...args)
 
template<class... TARGS>
UTIL_FORCEINLINE void make_success_base (TARGS &&...args)
 
template<class... TARGS>
UTIL_FORCEINLINE void make_error_base (TARGS &&...args)
 
void reset ()
 

Static Private Member Functions

template<class TSTORAGE , class... TARGS>
static UTIL_FORCEINLINE void make_object (typename TSTORAGE::storage_type &out, TARGS &&...args)
 
template<class TSTORAGE , class... TARGS>
static UTIL_FORCEINLINE void make_object (std::shared_ptr< typename TSTORAGE::storage_type > &out, TARGS &&...args)
 

Private Attributes

success_storage_type::storage_type success_data_
 
error_storage_type::storage_type error_data_
 
mode_type mode_
 

Friends

template<class UOK , class UERR >
class result_type
 
template<class TRESULT , bool >
struct _make_result_instance_helper
 
UTIL_FORCEINLINE friend void swap (result_base &l, result_base &r) LIBCOPP_MACRO_NOEXCEPT
 

Detailed Description

template<class TOK, class TERR>
class future::result_base< TOK, TERR, false >

Definition at line 456 of file storage.h.

Member Typedef Documentation

◆ error_storage_type

template<class TOK , class TERR >
using future::result_base< TOK, TERR, false >::error_storage_type = typename default_compact_storage<error_type>::type
private

Definition at line 566 of file storage.h.

◆ error_type

template<class TOK , class TERR >
using future::result_base< TOK, TERR, false >::error_type = TERR

Definition at line 459 of file storage.h.

◆ success_storage_type

template<class TOK , class TERR >
using future::result_base< TOK, TERR, false >::success_storage_type = typename default_compact_storage<success_type>::type
private

Definition at line 565 of file storage.h.

◆ success_type

template<class TOK , class TERR >
using future::result_base< TOK, TERR, false >::success_type = TOK

Definition at line 458 of file storage.h.

Member Enumeration Documentation

◆ mode_type

template<class TOK , class TERR >
enum future::result_base< TOK, TERR, false >::mode_type
Enumerator
EN_RESULT_SUCCESS 
EN_RESULT_ERROR 
EN_RESULT_NONE 

Definition at line 460 of file storage.h.

Constructor & Destructor Documentation

◆ result_base() [1/2]

template<class TOK , class TERR >
future::result_base< TOK, TERR, false >::result_base ( )
inline

Definition at line 482 of file storage.h.

◆ ~result_base()

template<class TOK , class TERR >
future::result_base< TOK, TERR, false >::~result_base ( )
inline

Definition at line 486 of file storage.h.

◆ result_base() [2/2]

template<class TOK , class TERR >
future::result_base< TOK, TERR, false >::result_base ( result_base< TOK, TERR, false > &&  other)
inline

Definition at line 488 of file storage.h.

References util::swap().

Member Function Documentation

◆ construct_error()

template<class TOK , class TERR >
template<class... TARGS>
UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::construct_error ( TARGS &&...  args)
inlineprivate

Definition at line 524 of file storage.h.

◆ construct_success()

template<class TOK , class TERR >
template<class... TARGS>
UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::construct_success ( TARGS &&...  args)
inlineprivate

Definition at line 517 of file storage.h.

◆ get_error() [1/2]

template<class TOK , class TERR >
UTIL_FORCEINLINE const error_type* future::result_base< TOK, TERR, false >::get_error ( ) const
inline

Definition at line 475 of file storage.h.

◆ get_error() [2/2]

template<class TOK , class TERR >
UTIL_FORCEINLINE error_type* future::result_base< TOK, TERR, false >::get_error ( )
inline

Definition at line 478 of file storage.h.

◆ get_success() [1/2]

template<class TOK , class TERR >
UTIL_FORCEINLINE const success_type* future::result_base< TOK, TERR, false >::get_success ( ) const
inline

Definition at line 469 of file storage.h.

◆ get_success() [2/2]

template<class TOK , class TERR >
UTIL_FORCEINLINE success_type* future::result_base< TOK, TERR, false >::get_success ( )
inline

Definition at line 472 of file storage.h.

◆ is_error()

template<class TOK , class TERR >
UTIL_FORCEINLINE bool future::result_base< TOK, TERR, false >::is_error ( ) const
inline

Definition at line 467 of file storage.h.

◆ is_success()

template<class TOK , class TERR >
UTIL_FORCEINLINE bool future::result_base< TOK, TERR, false >::is_success ( ) const
inline

Definition at line 466 of file storage.h.

◆ make_error_base()

template<class TOK , class TERR >
template<class... TARGS>
UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::make_error_base ( TARGS &&...  args)
inlineprivate

Definition at line 538 of file storage.h.

◆ make_object() [1/2]

template<class TOK , class TERR >
template<class TSTORAGE , class... TARGS>
static UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::make_object ( std::shared_ptr< typename TSTORAGE::storage_type > &  out,
TARGS &&...  args 
)
inlinestaticprivate

Definition at line 561 of file storage.h.

◆ make_object() [2/2]

template<class TOK , class TERR >
template<class TSTORAGE , class... TARGS>
static UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::make_object ( typename TSTORAGE::storage_type &  out,
TARGS &&...  args 
)
inlinestaticprivate

Definition at line 556 of file storage.h.

◆ make_success_base()

template<class TOK , class TERR >
template<class... TARGS>
UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::make_success_base ( TARGS &&...  args)
inlineprivate

Definition at line 531 of file storage.h.

◆ operator=()

template<class TOK , class TERR >
result_base& future::result_base< TOK, TERR, false >::operator= ( result_base< TOK, TERR, false > &&  other)
inline

Definition at line 495 of file storage.h.

References util::swap().

◆ reset()

template<class TOK , class TERR >
void future::result_base< TOK, TERR, false >::reset ( )
inlineprivate

Definition at line 544 of file storage.h.

◆ swap()

template<class TOK , class TERR >
UTIL_FORCEINLINE void future::result_base< TOK, TERR, false >::swap ( result_base< TOK, TERR, false > &  other)
inline

Definition at line 501 of file storage.h.

References util::swap().

Friends And Related Function Documentation

◆ _make_result_instance_helper

template<class TOK , class TERR >
template<class TRESULT , bool >
friend struct _make_result_instance_helper
friend

Definition at line 514 of file storage.h.

◆ result_type

template<class TOK , class TERR >
template<class UOK , class UERR >
friend class result_type
friend

Definition at line 512 of file storage.h.

◆ swap

template<class TOK , class TERR >
UTIL_FORCEINLINE friend void swap ( result_base< TOK, TERR, false > &  l,
result_base< TOK, TERR, false > &  r 
)
friend

Definition at line 508 of file storage.h.

Field Documentation

◆ error_data_

template<class TOK , class TERR >
error_storage_type::storage_type future::result_base< TOK, TERR, false >::error_data_
private

Definition at line 569 of file storage.h.

◆ mode_

template<class TOK , class TERR >
mode_type future::result_base< TOK, TERR, false >::mode_
private

Definition at line 570 of file storage.h.

◆ success_data_

template<class TOK , class TERR >
success_storage_type::storage_type future::result_base< TOK, TERR, false >::success_data_
private

Definition at line 568 of file storage.h.


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