ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
original::async::future< void > Class Referencefinal

Specialization of future for void results. More...

#include <async.h>

Inheritance diagram for original::async::future< void >:
Inheritance graph
Collaboration diagram for original::async::future< void >:
Collaboration graph

Public Member Functions

 future (const future &)=delete
 
futureoperator= (const future &)=delete
 
 future (future &&)=default
 
futureoperator= (future &&)=default
 
bool valid () const noexcept override
 Checks if the future is valid (has an associated async wrapper)
 
sharedFuture< voidshare ()
 Converts this future to a shared future.
 
void result ()
 Waits for completion and checks for exceptions.
 
bool ready () const override
 Checks if the computation is completed.
 
std::exception_ptr exception () const noexcept override
 Gets the exception if computation failed.
 
void wait () const override
 Waits until the computation completes.
 
bool waitFor (time::duration timeout) const override
 Waits for the result with a timeout.
 

Friends

class async
 

Detailed Description

Specialization of future for void results.

Member Function Documentation

◆ exception()

std::exception_ptr original::async::future< void >::exception ( ) const
inlineoverridevirtualnoexcept

Gets the exception if computation failed.

Returns
Exception pointer (nullptr if no exception)

Implements original::async::futureBase.

◆ ready()

bool original::async::future< void >::ready ( ) const
inlineoverridevirtual

Checks if the computation is completed.

Returns
True if completed

Implements original::async::futureBase.

◆ result()

void original::async::future< void >::result ( )
inline

Waits for completion and checks for exceptions.

Exceptions
std::exceptionif the computation threw an exception

◆ share()

Converts this future to a shared future.

Returns
A shared future that shares the same async wrapper

◆ valid()

bool original::async::future< void >::valid ( ) const
inlineoverridevirtualnoexcept

Checks if the future is valid (has an associated async wrapper)

Returns
True if valid, false otherwise

Implements original::async::futureBase.

◆ wait()

void original::async::future< void >::wait ( ) const
inlineoverridevirtual

Waits until the computation completes.

Implements original::async::futureBase.

◆ waitFor()

bool original::async::future< void >::waitFor ( time::duration  timeout) const
inlineoverridevirtual

Waits for the result with a timeout.

Parameters
timeoutMaximum time to wait
Returns
True if result is ready within timeout, false otherwise

Implements original::async::futureBase.


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