piranha  0.10
Public Member Functions | List of all members
piranha::future_list< T > Class Template Reference

Class to store a list of futures. More...

#include <piranha/thread_pool.hpp>

Public Member Functions

 future_list ()=default
 Defaulted default constructor. More...
 
 future_list (const future_list &)=delete
 Deleted copy constructor.
 
 future_list (future_list &&)=delete
 Deleted move constructor.
 
 ~future_list ()
 Destructor. More...
 
void push_back (std::future< T > &&f)
 Move-insert a future. More...
 
void wait_all ()
 Wait on all the futures. More...
 
void get_all ()
 Get all the futures. More...
 

Detailed Description

template<typename T>
class piranha::future_list< T >

Class to store a list of futures.

This class is a minimal thin wrapper around an std::list of std::future<T> objects. The class provides convenience methods to interact with the set of futures in an exception-safe manner.

Definition at line 513 of file thread_pool.hpp.

Constructor & Destructor Documentation

◆ future_list()

template<typename T>
piranha::future_list< T >::future_list ( )
default

Defaulted default constructor.

This constructor will initialise an empty list of futures.

◆ ~future_list()

template<typename T>
piranha::future_list< T >::~future_list ( )
inline

Destructor.

Will call wait_all().

Definition at line 547 of file thread_pool.hpp.

Member Function Documentation

◆ get_all()

template<typename T>
void piranha::future_list< T >::get_all ( )
inline

Get all the futures.

This method will call get() on all the valid futures stored within the object. The return values resulting from the calls to get() will be ignored.

Exceptions
unspecifiedan exception stored by a future.

Definition at line 597 of file thread_pool.hpp.

◆ push_back()

template<typename T>
void piranha::future_list< T >::push_back ( std::future< T > &&  f)
inline

Move-insert a future.

Will move-insert the input future f into the internal container. If the insertion fails due to memory allocation errors and f is a valid future, then the method will wait on f before throwing the exception.

Parameters
fstd::future to be move-inserted.
Exceptions
unspecifiedany exception thrown by memory allocation errors.

Definition at line 561 of file thread_pool.hpp.

◆ wait_all()

template<typename T>
void piranha::future_list< T >::wait_all ( )
inline

Wait on all the futures.

This method will call wait() on all the valid futures stored within the object.

Definition at line 582 of file thread_pool.hpp.


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