BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fc::promise< T > Class Template Reference

#include <future.hpp>

Inheritance diagram for fc::promise< T >:
fc::promise_base

Public Types

typedef std::shared_ptr< promise< T > > ptr
 
- Public Types inherited from fc::promise_base
typedef std::shared_ptr< promise_baseptr
 

Public Member Functions

virtual ~promise ()
 
const T & wait (const microseconds &timeout=microseconds::maximum())
 
const T & wait_until (const time_point &tp)
 
void set_value (const T &v)
 
void set_value (T &&v)
 
template<typename CompletionHandler >
void on_complete (CompletionHandler &&c)
 
- Public Member Functions inherited from fc::promise_base
virtual ~promise_base ()
 
const char * get_desc () const
 
virtual void cancel (const char *reason FC_CANCELATION_REASON_DEFAULT_ARG)
 
bool canceled () const
 
bool ready () const
 
bool error () const
 
void set_exception (const fc::exception_ptr &e)
 

Static Public Member Functions

static ptr create (const char *desc FC_TASK_NAME_DEFAULT_ARG)
 
static ptr create (const T &val)
 
static ptr create (T &&val)
 

Protected Member Functions

 promise (const char *desc)
 
 promise (const T &val)
 
 promise (T &&val)
 
- Protected Member Functions inherited from fc::promise_base
 promise_base (const char *desc FC_TASK_NAME_DEFAULT_ARG)
 
void _wait (const microseconds &timeout_us)
 
void _wait_until (const time_point &timeout_us)
 
void _notify ()
 
void _set_value (const void *v)
 
void _on_complete (detail::completion_handler *c)
 

Protected Attributes

optional< T > result
 
- Protected Attributes inherited from fc::promise_base
const char * _cancellation_reason
 

Detailed Description

template<typename T = void>
class fc::promise< T >

Definition at line 109 of file future.hpp.

Member Typedef Documentation

◆ ptr

template<typename T = void>
typedef std::shared_ptr< promise<T> > fc::promise< T >::ptr

Definition at line 111 of file future.hpp.

Constructor & Destructor Documentation

◆ ~promise()

template<typename T = void>
virtual fc::promise< T >::~promise ( )
inlinevirtual

Definition at line 112 of file future.hpp.

◆ promise() [1/3]

template<typename T = void>
fc::promise< T >::promise ( const char *  desc)
inlineprotected

Definition at line 151 of file future.hpp.

◆ promise() [2/3]

template<typename T = void>
fc::promise< T >::promise ( const T &  val)
inlineprotected

Definition at line 152 of file future.hpp.

◆ promise() [3/3]

template<typename T = void>
fc::promise< T >::promise ( T &&  val)
inlineprotected

Definition at line 153 of file future.hpp.

Member Function Documentation

◆ create() [1/3]

template<typename T = void>
static ptr fc::promise< T >::create ( const char *desc  FC_TASK_NAME_DEFAULT_ARG)
inlinestatic

Definition at line 114 of file future.hpp.

◆ create() [2/3]

template<typename T = void>
static ptr fc::promise< T >::create ( const T &  val)
inlinestatic

Definition at line 118 of file future.hpp.

◆ create() [3/3]

template<typename T = void>
static ptr fc::promise< T >::create ( T &&  val)
inlinestatic

Definition at line 122 of file future.hpp.

◆ on_complete()

template<typename T = void>
template<typename CompletionHandler >
void fc::promise< T >::on_complete ( CompletionHandler &&  c)
inline

Definition at line 147 of file future.hpp.

◆ set_value() [1/2]

template<typename T = void>
void fc::promise< T >::set_value ( const T &  v)
inline

Definition at line 136 of file future.hpp.

◆ set_value() [2/2]

template<typename T = void>
void fc::promise< T >::set_value ( T &&  v)
inline

Definition at line 141 of file future.hpp.

◆ wait()

template<typename T = void>
const T& fc::promise< T >::wait ( const microseconds timeout = microseconds::maximum())
inline

Definition at line 127 of file future.hpp.

◆ wait_until()

template<typename T = void>
const T& fc::promise< T >::wait_until ( const time_point tp)
inline

Definition at line 131 of file future.hpp.

Member Data Documentation

◆ result

template<typename T = void>
optional<T> fc::promise< T >::result
protected

Definition at line 155 of file future.hpp.


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