|
QuantumLibrary
|
Exposes methods to manipulate the coroutine context, especially future wait methods. More...
#include <quantum_icoro_context_base.h>
Public Types | |
| using | Ptr = std::shared_ptr< ICoroContextBase > |
Public Types inherited from Bloomberg::quantum::IContextBase | |
| using | Ptr = std::shared_ptr< IContextBase > |
Public Types inherited from Bloomberg::quantum::ICoroSync | |
| using | Ptr = std::shared_ptr< ICoroSync > |
Public Member Functions | |
| virtual void | wait (ICoroSync::Ptr sync) const =0 |
| Waits for the future associated with this context to be ready. More... | |
| virtual std::future_status | waitFor (ICoroSync::Ptr sync, std::chrono::milliseconds timeMs) const =0 |
| Waits for the future associated with this context to be ready for a maximum of 'timeMs' milliseconds. More... | |
| virtual void | waitAt (int num, ICoroSync::Ptr sync) const =0 |
| Waits for the future in the 'num-th' continuation context to be ready. More... | |
| virtual std::future_status | waitForAt (int num, ICoroSync::Ptr sync, std::chrono::milliseconds timeMs) const =0 |
| Waits for the future in the 'num-th' continuation context to be ready for a maximum of 'timeMs' milliseconds. More... | |
| virtual void | waitAll (ICoroSync::Ptr sync) const =0 |
| Wait for all the futures in the continuation chain to be ready. More... | |
Public Member Functions inherited from Bloomberg::quantum::IContextBase | |
| virtual | ~IContextBase ()=default |
| Virtual destructor. More... | |
| virtual bool | valid () const =0 |
| Determines if the future object associated with this context has a valid shared state with the corresponding promise. More... | |
| virtual bool | validAt (int num) const =0 |
| Determines if the future object associated with the 'num'-th continuation context is still valid. More... | |
| virtual int | setException (std::exception_ptr ex)=0 |
| Set an exception in the promise associated with the current IThreadContext or ICoroContext. More... | |
Public Member Functions inherited from Bloomberg::quantum::ICoroSync | |
| virtual | ~ICoroSync ()=default |
| Default virtual destructor. More... | |
| virtual void | setYieldHandle (Traits::Yield &yield)=0 |
| Sets the underlying boost::coroutine object so that it can be yielded on. More... | |
| virtual Traits::Yield & | getYieldHandle ()=0 |
| Retrieve the underlying boost::coroutine object. More... | |
| virtual void | yield ()=0 |
| Explicitly yields this coroutine context. More... | |
| virtual std::atomic_int & | signal ()=0 |
| Accessor to the underlying synchronization variable. More... | |
| virtual void | sleep (const std::chrono::milliseconds &timeMs)=0 |
| Sleeps the coroutine associated with this context for at least 'timeMs' milliseconds or 'timeUs' microseconds depending on the overload chosen. More... | |
| virtual void | sleep (const std::chrono::microseconds &timeUs)=0 |
Exposes methods to manipulate the coroutine context, especially future wait methods.
| using Bloomberg::quantum::ICoroContextBase::Ptr = std::shared_ptr<ICoroContextBase> |
|
pure virtual |
Waits for the future associated with this context to be ready.
| [in] | sync | Pointer to the coroutine synchronization object. |
Implemented in Bloomberg::quantum::Context< RET >.
|
pure virtual |
Wait for all the futures in the continuation chain to be ready.
| [in] | sync | Pointer to the coroutine synchronization object. |
Implemented in Bloomberg::quantum::Context< RET >.
|
pure virtual |
Waits for the future in the 'num-th' continuation context to be ready.
Allowed range for num is [-1, total_continuations). -1 is equivalent of calling wait() or waitAt(total_continuations-1) on the last context in the chain (i.e. the context which is returned via end()). Position 0 represents the first future in the chain.
| [in] | num | The number indicating which future to wait on. |
| [in] | sync | Pointer to the coroutine synchronization object. |
Implemented in Bloomberg::quantum::Context< RET >.
|
pure virtual |
Waits for the future associated with this context to be ready for a maximum of 'timeMs' milliseconds.
| [in] | sync | Pointer to the coroutine synchronization object. |
| [in] | timeMs | The maximum amount of milliseconds to wait until the future value becomes ready. |
Implemented in Bloomberg::quantum::Context< RET >.
|
pure virtual |
Waits for the future in the 'num-th' continuation context to be ready for a maximum of 'timeMs' milliseconds.
Allowed range for num is [-1, total_continuations). -1 is equivalent of calling wait() or waitAt(total_continuations-1) on the last context in the chain (i.e. the context which is returned via end()). Position 0 represents the first future in the chain.
| [in] | num | The number indicating which future to wait on. |
| [in] | sync | Pointer to the coroutine synchronization object. |
| [in] | timeMs | The maximum amount of milliseconds to wait until the future value becomes ready. |
Implemented in Bloomberg::quantum::Context< RET >.