QuantumLibrary
|
Exposes methods to access and manipulate a non-coroutine promise (i.e. used in a thread) More...
#include <quantum_ithread_promise.h>
Public Types | |
using | ContextTag = ThreadContextTag |
using | Ptr = std::shared_ptr< IThreadPromise< PROMISE, T > > |
using | Impl = PROMISE< T > |
Public Member Functions | |
IThreadPromise (Impl *derived) | |
Constructor. More... | |
virtual ThreadFuturePtr< T > | getIThreadFuture () const =0 |
Get the associated thread future. More... | |
template<class V , class = NonBufferType<T,V>> | |
int | set (V &&value) |
Set the promised value. More... | |
template<class V , class = BufferType<T,V>> | |
void | push (V &&value) |
Push a single value into the promise buffer. More... | |
template<class V = T, class = BufferRetType<V>> | |
int | closeBuffer () |
Close a promise buffer. More... | |
![]() | |
virtual | ~DerivedFrom ()=default |
operator IPromiseBase * () | |
operator IPromiseBase & () | |
Exposes methods to access and manipulate a non-coroutine promise (i.e. used in a thread)
PROMISE | The derived promise (concrete type). |
T | The type of value contained in this promise. |
using Bloomberg::quantum::IThreadPromise< PROMISE, T >::ContextTag = ThreadContextTag |
using Bloomberg::quantum::IThreadPromise< PROMISE, T >::Impl = PROMISE<T> |
using Bloomberg::quantum::IThreadPromise< PROMISE, T >::Ptr = std::shared_ptr<IThreadPromise<PROMISE, T> > |
|
inline |
Constructor.
[in] | derived | A pointer to the concrete implementation of this class. |
int Bloomberg::quantum::IThreadPromise< PROMISE, T >::closeBuffer | ( | ) |
Close a promise buffer.
BUF | Represents a class of type Buffer. |
|
pure virtual |
Get the associated thread future.
Implemented in Bloomberg::quantum::Promise< T >.
void Bloomberg::quantum::IThreadPromise< PROMISE, T >::push | ( | V && | value | ) |
Push a single value into the promise buffer.
[in] | value | Value to push at the end of the buffer. |
int Bloomberg::quantum::IThreadPromise< PROMISE, T >::set | ( | V && | value | ) |
Set the promised value.
V | The type of the value. Must be implicitly deduced by the compiler and should always be == T. |
[in] | value | A reference to the value (l-value or r-value). |