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

Represents a stream of values that will be eventually available. More...

#include <stream_future.h>

Public Types

using storage_type = detail::Stream_storage< Alloc, Ts... >
 The underlying storage type.
 
using fullfill_type = typename storage_type::fullfill_type
 

Public Member Functions

 Basic_stream_future ()=default
 Default construction. More...
 
 Basic_stream_future (Basic_stream_future &&)=default
 Move construction. More...
 
Basic_stream_futureoperator= (Basic_stream_future &&)=default
 Move assignment. More...
 
template<typename CbT >
Basic_future< Alloc, void > for_each (CbT &&cb)
 Invokes a callback on each value in the stream wherever they are produced. More...
 
template<typename QueueT , typename CbT >
Basic_future< Alloc, void > for_each (QueueT &queue, CbT &&cb)
 Posts the execution of a callback to a queue when values are produced. More...
 

Friends

template<typename SubAlloc , typename... Us>
class Basic_stream_promise
 

Detailed Description

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

Represents a stream of values that will be eventually available.

Template Parameters
AllocThe rebindable allocator to use.
TsThe types making up the stream fields.

Constructor & Destructor Documentation

◆ Basic_stream_future() [1/2]

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

Default construction.

◆ Basic_stream_future() [2/2]

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

Move construction.

Member Function Documentation

◆ for_each() [1/2]

template<typename Alloc , typename... Ts>
template<typename CbT >
Basic_future<Alloc, void> aom::Basic_stream_future< Alloc, Ts >::for_each ( CbT &&  cb)

Invokes a callback on each value in the stream wherever they are produced.

Template Parameters
CbT
Parameters
cbThe callback to invoke on each value.
Returns
Basic_future<Alloc, void> A future that will be completed at the end of the stream.

◆ for_each() [2/2]

template<typename Alloc , typename... Ts>
template<typename QueueT , typename CbT >
Basic_future<Alloc, void> aom::Basic_stream_future< Alloc, Ts >::for_each ( QueueT &  queue,
CbT &&  cb 
)

Posts the execution of a callback to a queue when values are produced.

Template Parameters
QueueT
CbT
Parameters
queuecb will be posted to that queue
cbthe callback to invoke.
Returns
Basic_future<Alloc, void> A future that will be completed at the end of the stream.

◆ operator=()

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

Move assignment.

Returns
Basic_stream_future&

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