QuantumLibrary
Bloomberg::quantum::ICoroFutureBase Interface Referenceabstract

Exposes methods to access a coroutine-compatible future. More...

#include <quantum_icoro_future_base.h>

Inheritance diagram for Bloomberg::quantum::ICoroFutureBase:
Bloomberg::quantum::ICoroFuture< T > Bloomberg::quantum::Future< T >

Public Types

using Ptr = std::shared_ptr< ICoroFutureBase >
 

Public Member Functions

virtual ~ICoroFutureBase ()=default
 Virtual destructor. More...
 
virtual bool valid () const =0
 Determines if this future still has a shared state with the corresponding promise object. More...
 
virtual void wait (ICoroSync::Ptr sync) const =0
 Waits for the future value. More...
 
virtual std::future_status waitFor (ICoroSync::Ptr sync, std::chrono::milliseconds timeMs) const =0
 Waits for the future value up to a maximum 'timeMs' milliseconds. More...
 

Detailed Description

Exposes methods to access a coroutine-compatible future.

Exposes methods to access a non-coroutine future (i.e. accessed from a thread)

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ~ICoroFutureBase()

virtual Bloomberg::quantum::ICoroFutureBase::~ICoroFutureBase ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ valid()

virtual bool Bloomberg::quantum::ICoroFutureBase::valid ( ) const
pure virtual

Determines if this future still has a shared state with the corresponding promise object.

Returns
True if valid, false otherwise.

Implemented in Bloomberg::quantum::Future< T >.

◆ wait()

virtual void Bloomberg::quantum::ICoroFutureBase::wait ( ICoroSync::Ptr  sync) const
pure virtual

Waits for the future value.

Parameters
[in]syncA pointer to a coroutine synchronization object.
Note
This method blocks until the future is ready or until an exception is thrown.

Implemented in Bloomberg::quantum::Future< T >.

◆ waitFor()

virtual std::future_status Bloomberg::quantum::ICoroFutureBase::waitFor ( ICoroSync::Ptr  sync,
std::chrono::milliseconds  timeMs 
) const
pure virtual

Waits for the future value up to a maximum 'timeMs' milliseconds.

Parameters
[in]syncA pointer to a coroutine synchronization object.
[in]timeMsThe maximum amount of milliseconds to wait until the future value becomes ready.
Returns
'ready' if value was posted before duration expired or 'timeout' otherwise.
Note
Blocks until the value is ready, until 'timeMs' duration expires or until an exception is thrown.

Implemented in Bloomberg::quantum::Future< T >.