MCPcopy Create free account
hub / github.com/boostorg/asio / coroutine

Class coroutine

include/boost/asio/coroutine.hpp:245–263  ·  view source on GitHub ↗

Provides support for implementing stackless coroutines. * The @c coroutine class may be used to implement stackless coroutines. The * class itself is used to store the current state of the coroutine. * * Coroutines are copy-constructible and assignable, and the space overhead is * a single int. They can be used as a base class: * * @code class session : coroutine * { * ... * }; @endcode

Source from the content-addressed store, hash-verified

243 * @li @c BOOST_ASIO_CORO_FORK instead of @c fork
244 */
245class coroutine
246{
247public:
248 /// Constructs a coroutine in its initial state.
249 coroutine() : value_(0) {}
250
251 /// Returns true if the coroutine is the child of a fork.
252 bool is_child() const { return value_ < 0; }
253
254 /// Returns true if the coroutine is the parent of a fork.
255 bool is_parent() const { return !is_child(); }
256
257 /// Returns true if the coroutine has reached its terminal state.
258 bool is_complete() const { return value_ == -1; }
259
260private:
261 friend class detail::coroutine_ref;
262 int value_;
263};
264
265namespace detail {
266

Callers 3

async_write_messagesFunction · 0.85
async_write_messagesFunction · 0.85
async_write_messagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected