QuantumLibrary
|
Class representing a promised future. Can only be instantiated via a Promise object. More...
#include <quantum_icoro_future.h>
Public Types | |
using | Ptr = std::shared_ptr< Future< T > > |
![]() | |
using | ContextTag = ThreadContextTag |
using | Ptr = std::shared_ptr< IThreadFuture< T > > |
using | Impl = Future< T > |
![]() | |
using | Ptr = std::shared_ptr< IThreadFutureBase > |
![]() | |
using | ContextTag = CoroContextTag |
using | Ptr = std::shared_ptr< ICoroFuture< T > > |
using | Impl = Future< T > |
![]() | |
using | Ptr = std::shared_ptr< ICoroFutureBase > |
Public Member Functions | |
Future ()=default | |
bool | valid () const final |
Determines if this future still has a shared state with the corresponding promise object. More... | |
void | wait () const final |
Waits for the future value. More... | |
std::future_status | waitFor (std::chrono::milliseconds timeMs) const final |
Waits for the future value up to a maximum 'timeMs' milliseconds. More... | |
template<class V = T> | |
NonBufferRetType< V > | get () |
template<class V = T> | |
const NonBufferRetType< V > & | getRef () const |
template<class V = T> | |
BufferRetType< V > | pull (bool &isBufferClosed) |
void | wait (ICoroSync::Ptr sync) const final |
Waits for the future value. More... | |
std::future_status | waitFor (ICoroSync::Ptr sync, std::chrono::milliseconds timeMs) const final |
Waits for the future value up to a maximum 'timeMs' milliseconds. More... | |
template<class V = T> | |
NonBufferRetType< V > | get (ICoroSync::Ptr sync) |
Get the future value. More... | |
template<class V = T> | |
const NonBufferRetType< V > & | getRef (ICoroSync::Ptr sync) const |
Get a reference the future value. More... | |
template<class V = T> | |
BufferRetType< V > | pull (ICoroSync::Ptr sync, bool &isBufferClosed) |
Pull a single value from the future buffer. More... | |
![]() | |
template<class V = T> | |
NonBufferRetType< V > | get () |
Get the future value. More... | |
template<class V = T> | |
const NonBufferRetType< V > & | getRef () const |
Get a reference the future value. More... | |
template<class V = T> | |
BufferRetType< V > | pull (bool &isBufferClosed) |
Pull a single value from the future buffer. More... | |
![]() | |
virtual | ~IThreadFutureBase ()=default |
Virtual destructor. More... | |
![]() | |
virtual | ~ICoroFutureBase ()=default |
Virtual destructor. More... | |
Static Public Member Functions | |
static void * | operator new (size_t size) |
static void | operator delete (void *p) |
static void | deleter (Future< T > *p) |
Friends | |
template<class F > | |
class | Promise |
Class representing a promised future. Can only be instantiated via a Promise object.
T | Type of value returned by the future object. |
using Bloomberg::quantum::Future< T >::Ptr = std::shared_ptr<Future<T> > |
|
default |
|
static |
NonBufferRetType< V > Bloomberg::quantum::Future< T >::get | ( | ) |
NonBufferRetType< V > Bloomberg::quantum::Future< T >::get | ( | ICoroSync::Ptr | sync | ) |
Get the future value.
[in] | sync | Pointer to the coroutine synchronization object. |
Implements Bloomberg::quantum::ICoroFuture< T >.
const NonBufferRetType< V > & Bloomberg::quantum::Future< T >::getRef | ( | ) | const |
const NonBufferRetType< V > & Bloomberg::quantum::Future< T >::getRef | ( | ICoroSync::Ptr | sync | ) | const |
Get a reference the future value.
[in] | sync | Pointer to the coroutine synchronization object. |
Implements Bloomberg::quantum::ICoroFuture< T >.
|
static |
|
static |
BufferRetType< V > Bloomberg::quantum::Future< T >::pull | ( | bool & | isBufferClosed | ) |
BufferRetType< V > Bloomberg::quantum::Future< T >::pull | ( | ICoroSync::Ptr | sync, |
bool & | isBufferClosed | ||
) |
Pull a single value from the future buffer.
[in] | sync | Pointer to the coroutine synchronization object. |
[out] | isBufferClosed | Indicates if this buffer is closed and no more Pull operations are allowed on it. |
Implements Bloomberg::quantum::ICoroFuture< T >.
|
finalvirtual |
Determines if this future still has a shared state with the corresponding promise object.
Implements Bloomberg::quantum::ICoroFutureBase.
|
finalvirtual |
Waits for the future value.
Implements Bloomberg::quantum::IThreadFutureBase.
|
finalvirtual |
Waits for the future value.
[in] | sync | A pointer to a coroutine synchronization object. |
Implements Bloomberg::quantum::ICoroFutureBase.
|
finalvirtual |
Waits for the future value up to a maximum 'timeMs' milliseconds.
[in] | timeMs | The maximum amount of milliseconds to wait until the future value becomes ready. |
Implements Bloomberg::quantum::IThreadFutureBase.
|
finalvirtual |
Waits for the future value up to a maximum 'timeMs' milliseconds.
[in] | sync | A pointer to a coroutine synchronization object. |
[in] | timeMs | The maximum amount of milliseconds to wait until the future value becomes ready. |
Implements Bloomberg::quantum::ICoroFutureBase.