RADLib
RADical C++ application framework
RADCore::RADFuture Class Reference

Shared future wrapper returning RADVariant results. More...

#include <RADCore.h>

Public Member Functions

 RADFuture ()
 Creates an invalid future. More...
 
 RADFuture (std::shared_ptr< std::shared_future< RADVariant >> future)
 Wraps an existing shared future. More...
 
bool isValid () const
 Returns true when a future is present. More...
 
bool isFinished () const
 Returns true when the result is ready. More...
 
RADVariant result (RADVariant defaultValue={}) const
 Returns result or defaultValue if not ready or failed. More...
 
void wait () const
 Blocks until the future is ready. More...
 

Detailed Description

Shared future wrapper returning RADVariant results.

Constructor & Destructor Documentation

◆ RADFuture() [1/2]

RADCore::RADFuture::RADFuture ( )

Creates an invalid future.

◆ RADFuture() [2/2]

RADCore::RADFuture::RADFuture ( std::shared_ptr< std::shared_future< RADVariant >>  future)
explicit

Wraps an existing shared future.

Member Function Documentation

◆ isFinished()

bool RADCore::RADFuture::isFinished ( ) const

Returns true when the result is ready.

◆ isValid()

bool RADCore::RADFuture::isValid ( ) const

Returns true when a future is present.

◆ result()

RADVariant RADCore::RADFuture::result ( RADVariant  defaultValue = {}) const

Returns result or defaultValue if not ready or failed.

◆ wait()

void RADCore::RADFuture::wait ( ) const

Blocks until the future is ready.


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