libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
Future< void > Class Reference

Specialization of Future for void results. More...

#include <future.h>

Public Member Functions

 Future ()=default
 Constructs an invalid (empty) Future.
 
 Future (std::future< void > &&f)
 Constructs a Future from a std::future.
 
 ~Future ()=default
 Destructor.
 
 Future (const Future &)=delete
 
Futureoperator= (const Future &)=delete
 
 Future (Future &&other)=default
 
Futureoperator= (Future &&other)=default
 
bool isReady () const
 Checks whether the result is ready without blocking.
 
Error result (unsigned int timeoutMs=0)
 Waits for completion and returns the status.
 
void waitForFinished ()
 Blocks until the result is ready.
 
Error waitForFinished (unsigned int timeoutMs)
 Blocks until the result is ready or the timeout expires.
 
bool isValid () const
 Returns whether this Future holds a valid shared state.
 

Detailed Description

Specialization of Future for void results.

Provides the same interface but result() returns just an Error.

Member Function Documentation

◆ isReady()

bool Future< void >::isReady ( ) const
inline

Checks whether the result is ready without blocking.

Returns
True if the result is available.

◆ isValid()

bool Future< void >::isValid ( ) const
inline

Returns whether this Future holds a valid shared state.

Returns
True if a result can be retrieved.

◆ result()

Error Future< void >::result ( unsigned int  timeoutMs = 0)
inline

Waits for completion and returns the status.

Parameters
timeoutMsMaximum time to wait in milliseconds. A value of 0 (the default) waits indefinitely.
Returns
Error::Ok on completion, Error::Timeout on timeout.

◆ waitForFinished()

Error Future< void >::waitForFinished ( unsigned int  timeoutMs)
inline

Blocks until the result is ready or the timeout expires.

Parameters
timeoutMsMaximum time to wait in milliseconds.
Returns
Error::Ok if finished, Error::Timeout if the timeout elapsed.

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