#include <quantum_ithread_future.h>
|
| 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 bool | valid () const =0 |
| | Determines if this future still has a shared state with the promise object. More...
|
| |
| virtual void | wait () const =0 |
| | Waits for the future value. More...
|
| |
| virtual std::future_status | waitFor (std::chrono::milliseconds timeMs) const =0 |
| | Waits for the future value up to a maximum 'timeMs' milliseconds. More...
|
| |
◆ ContextTag
◆ Impl
◆ Ptr
◆ get()
template<class T >
template<class V >
Get the future value.
- Returns
- The future value.
- Note
- Blocks until the future is ready or until an exception is thrown. Once this function returns, the future becomes invalidated (i.e. cannot be read again)
◆ getRef()
template<class T >
template<class V >
Get a reference the future value.
- Returns
- A reference to the future value.
- Note
- Blocks until the future is ready or until an exception is thrown. Contrary to get(), this function does not invalidate the future and as such may be read again.
◆ pull()
template<class T >
template<class V >
Pull a single value from the future buffer.
- Template Parameters
-
| BUF | Represents a class of type Buffer. |
| V | The type of value contained in Buffer. |
- Parameters
-
| [out] | isBufferClosed | Indicates if this buffer is closed and no more Pull operations are allowed on it. |
- Returns
- The next value pulled out from the front of the buffer.
- Note
- Method available for buffered futures only. Blocks until one value is retrieved from the buffer.