Variadic Futures
Public Types | Public Member Functions | List of all members
aom::Basic_stream_promise< Alloc, Ts > Class Template Reference

#include <stream_future.h>

Public Types

using future_type = Basic_stream_future< Alloc, Ts... >
 
using storage_type = typename future_type::storage_type
 
using fullfill_type = typename storage_type::fullfill_type
 
using fail_type = std::exception_ptr
 

Public Member Functions

 Basic_stream_promise ()
 Construct a new Basic_stream_promise object. More...
 
 Basic_stream_promise (Basic_stream_promise &&)=default
 Construct a new Basic_stream_promise object. More...
 
Basic_stream_promiseoperator= (Basic_stream_promise &&)=default
 
 ~Basic_stream_promise ()
 Destroy the Basic_stream_promise object. More...
 
future_type get_future (const Alloc &alloc=Alloc())
 Get the future object. More...
 
template<typename... Us>
void push (Us &&...)
 Add a datapoint to the stream. More...
 
void complete ()
 Closes the stream. More...
 
void set_exception (fail_type)
 Notify failure of the stream. More...
 
 operator bool () const
 returns wether the promise still refers to an uncompleted future More...
 

Detailed Description

template<typename Alloc, typename... Ts>
class aom::Basic_stream_promise< Alloc, Ts >

Template Parameters
Alloc
Ts

Constructor & Destructor Documentation

◆ Basic_stream_promise() [1/2]

template<typename Alloc , typename... Ts>
aom::Basic_stream_promise< Alloc, Ts >::Basic_stream_promise ( )

Construct a new Basic_stream_promise object.

◆ Basic_stream_promise() [2/2]

template<typename Alloc , typename... Ts>
aom::Basic_stream_promise< Alloc, Ts >::Basic_stream_promise ( Basic_stream_promise< Alloc, Ts > &&  )
default

Construct a new Basic_stream_promise object.

◆ ~Basic_stream_promise()

template<typename Alloc , typename... Ts>
aom::Basic_stream_promise< Alloc, Ts >::~Basic_stream_promise ( )

Destroy the Basic_stream_promise object.

Member Function Documentation

◆ complete()

template<typename Alloc , typename... Ts>
void aom::Basic_stream_promise< Alloc, Ts >::complete ( )

Closes the stream.

◆ get_future()

template<typename Alloc , typename... Ts>
future_type aom::Basic_stream_promise< Alloc, Ts >::get_future ( const Alloc &  alloc = Alloc())

Get the future object.

Parameters
alloc
Returns
future_type

◆ operator bool()

template<typename Alloc , typename... Ts>
aom::Basic_stream_promise< Alloc, Ts >::operator bool ( ) const

returns wether the promise still refers to an uncompleted future

Returns
true
false

◆ operator=()

template<typename Alloc , typename... Ts>
Basic_stream_promise& aom::Basic_stream_promise< Alloc, Ts >::operator= ( Basic_stream_promise< Alloc, Ts > &&  )
default

◆ push()

template<typename Alloc , typename... Ts>
template<typename... Us>
void aom::Basic_stream_promise< Alloc, Ts >::push ( Us &&  ...)

Add a datapoint to the stream.

Template Parameters
Us

◆ set_exception()

template<typename Alloc , typename... Ts>
void aom::Basic_stream_promise< Alloc, Ts >::set_exception ( fail_type  )

Notify failure of the stream.


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