Realistic 3D camera system
3D camera system components
|
Context object the represents the currently executing coroutine. More...
#include <spawn.hpp>
Public Types | |
typedef boost::coroutines::coroutine< void()> | callee_type |
The coroutine callee type, used by the implementation. More... | |
typedef boost::coroutines::coroutine< void()>::caller_type | caller_type |
The coroutine caller type, used by the implementation. More... | |
Public Member Functions | |
basic_yield_context (const detail::weak_ptr< callee_type > &coro, caller_type &ca, Handler &handler) | |
Construct a yield context to represent the specified coroutine. More... | |
basic_yield_context | operator[] (asio::error_code &ec) const |
Return a yield context that sets the specified error_code. More... | |
Public Attributes | |
detail::weak_ptr< callee_type > | coro_ |
caller_type & | ca_ |
Handler & | handler_ |
asio::error_code * | ec_ |
Context object the represents the currently executing coroutine.
The basic_yield_context class is used to represent the currently executing stackful coroutine. A basic_yield_context may be passed as a handler to an asynchronous operation. For example:
The initiating function (async_read_some in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned.
typedef boost::coroutines::coroutine<void()> asio::basic_yield_context< Handler >::callee_type |
The coroutine callee type, used by the implementation.
When using Boost.Coroutine v1, this type is:
When using Boost.Coroutine v2 (unidirectional coroutines), this type is:
typedef boost::coroutines::coroutine<void()>::caller_type asio::basic_yield_context< Handler >::caller_type |
The coroutine caller type, used by the implementation.
When using Boost.Coroutine v1, this type is:
When using Boost.Coroutine v2 (unidirectional coroutines), this type is:
|
inline |
|
inline |
Return a yield context that sets the specified error_code.
By default, when a yield context is used with an asynchronous operation, a non-success error_code is converted to system_error and thrown. This operator may be used to specify an error_code object that should instead be set with the asynchronous operation's result. For example:
caller_type& asio::basic_yield_context< Handler >::ca_ |
detail::weak_ptr<callee_type> asio::basic_yield_context< Handler >::coro_ |
asio::error_code* asio::basic_yield_context< Handler >::ec_ |
Handler& asio::basic_yield_context< Handler >::handler_ |