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 | Friends | List of all members
threadman::SharedFuture< T > Class Template Reference

#include <future.hpp>

Public Types

using value_type = T
 

Public Member Functions

 SharedFuture ()=default
 
 SharedFuture (const SharedFuture &)=default
 
 SharedFuture (SharedFuture &&) noexcept=default
 
SharedFutureoperator= (const SharedFuture &)=default
 
SharedFutureoperator= (SharedFuture &&) noexcept=default
 
 ~SharedFuture ()=default
 
bool valid () const noexcept
 
bool is_ready () const noexcept
 
void wait () const
 
template<class Rep , class Period >
bool wait_for (const std::chrono::duration< Rep, Period > &dur) const
 
template<class U = T>
requires (!std::is_void_v<U>)
const U & get () const
 Non-consuming read.
 
template<class U = T>
requires std::is_void_v<U>
void get () const
 
template<class Exec , class Fn >
auto then (Exec &exec, Fn &&fn) const
 
template<class Exec , class Fn >
SharedFuture< T > on_error (Exec &exec, Fn &&fn) const
 
FutureSnapshot snapshot () const
 

Static Public Member Functions

static const comms::DisplayInfo & display_info ()
 

Friends

template<class U >
class Future
 
template<class U >
class SharedFuture
 
template<class U >
class Promise
 

Member Typedef Documentation

◆ value_type

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

Constructor & Destructor Documentation

◆ SharedFuture() [1/3]

template<class T >
threadman::SharedFuture< T >::SharedFuture ( )
default

◆ SharedFuture() [2/3]

template<class T >
threadman::SharedFuture< T >::SharedFuture ( const SharedFuture< T > &  )
default

◆ SharedFuture() [3/3]

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

◆ ~SharedFuture()

template<class T >
threadman::SharedFuture< T >::~SharedFuture ( )
default

Member Function Documentation

◆ display_info()

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

◆ get() [1/2]

template<class T >
template<class U = T>
requires (!std::is_void_v<U>)
const U & threadman::SharedFuture< T >::get ( ) const
inline

Non-consuming read.

For non-void T returns a const T&; the underlying value is owned by the state. For void T it's a no-op wait-and-rethrow.

◆ get() [2/2]

template<class T >
template<class U = T>
requires std::is_void_v<U>
void threadman::SharedFuture< T >::get ( ) const
inline

◆ is_ready()

template<class T >
bool threadman::SharedFuture< T >::is_ready ( ) const
inlinenoexcept

◆ on_error()

template<class T >
template<class Exec , class Fn >
SharedFuture< T > threadman::SharedFuture< T >::on_error ( Exec &  exec,
Fn &&  fn 
) const

◆ operator=() [1/2]

template<class T >
SharedFuture & threadman::SharedFuture< T >::operator= ( const SharedFuture< T > &  )
default

◆ operator=() [2/2]

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

◆ snapshot()

template<class T >
FutureSnapshot threadman::SharedFuture< T >::snapshot ( ) const
inline

◆ then()

template<class T >
template<class Exec , class Fn >
auto threadman::SharedFuture< T >::then ( Exec &  exec,
Fn &&  fn 
) const

◆ valid()

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

◆ wait()

template<class T >
void threadman::SharedFuture< T >::wait ( ) const
inline

◆ wait_for()

template<class T >
template<class Rep , class Period >
bool threadman::SharedFuture< T >::wait_for ( const std::chrono::duration< Rep, Period > &  dur) const
inline

Friends And Related Symbol Documentation

◆ Future

template<class T >
template<class U >
friend class Future
friend

◆ Promise

template<class T >
template<class U >
friend class Promise
friend

◆ SharedFuture

template<class T >
template<class U >
friend class SharedFuture
friend

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