threadman 0.1.0
Header-only C++23 managed threads, dynamic pools, futures, and executors
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
threadman::Promise< T > Class Template Reference

#include <future.hpp>

Public Types

using value_type = T
 

Public Member Functions

 Promise ()
 
 Promise (const Promise &)=delete
 
Promiseoperator= (const Promise &)=delete
 
 Promise (Promise &&) noexcept=default
 
Promiseoperator= (Promise &&) noexcept=default
 
 ~Promise ()
 
bool valid () const noexcept
 
Future< T > get_future ()
 Retrieve the future.
 
template<class U = T>
requires (!std::is_void_v<U>)
void set_value (U &&v)
 
template<class U = T>
requires std::is_void_v<U>
void set_value ()
 
void set_exception (const std::exception_ptr &ex)
 

Static Public Member Functions

static const comms::DisplayInfo & display_info ()
 

Member Typedef Documentation

◆ value_type

template<class T >
using threadman::Promise< T >::value_type = T

Constructor & Destructor Documentation

◆ Promise() [1/3]

template<class T >
threadman::Promise< T >::Promise ( )
inline

◆ Promise() [2/3]

template<class T >
threadman::Promise< T >::Promise ( const Promise< T > &  )
delete

◆ Promise() [3/3]

template<class T >
threadman::Promise< T >::Promise ( Promise< T > &&  )
defaultnoexcept

◆ ~Promise()

template<class T >
threadman::Promise< T >::~Promise ( )
inline

Member Function Documentation

◆ display_info()

template<class T >
static const comms::DisplayInfo & threadman::Promise< T >::display_info ( )
inlinestatic

◆ get_future()

template<class T >
Future< T > threadman::Promise< T >::get_future ( )
inline

Retrieve the future.

Throws FutureAlreadyRetrievedError on the second call.

◆ operator=() [1/2]

template<class T >
Promise & threadman::Promise< T >::operator= ( const Promise< T > &  )
delete

◆ operator=() [2/2]

template<class T >
Promise & threadman::Promise< T >::operator= ( Promise< T > &&  )
defaultnoexcept

◆ set_exception()

template<class T >
void threadman::Promise< T >::set_exception ( const std::exception_ptr &  ex)
inline

◆ set_value() [1/2]

template<class T >
template<class U = T>
requires std::is_void_v<U>
void threadman::Promise< T >::set_value ( )
inline

◆ set_value() [2/2]

template<class T >
template<class U = T>
requires (!std::is_void_v<U>)
void threadman::Promise< T >::set_value ( U &&  v)
inline

◆ valid()

template<class T >
bool threadman::Promise< T >::valid ( ) const
inlinenoexcept

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