11 #ifndef ASIO_IMPL_SPAWN_HPP 12 #define ASIO_IMPL_SPAWN_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 33 template <
typename Handler,
typename T>
64 shared_ptr<typename basic_yield_context<Handler>::callee_type>
coro_;
72 template <
typename Handler>
100 shared_ptr<typename basic_yield_context<Handler>::callee_type>
coro_;
107 template <
typename Handler,
typename T>
115 template <
typename Handler,
typename T>
120 pointer, size, this_handler->
handler_);
123 template <
typename Handler,
typename T>
129 template <
typename Function,
typename Handler,
typename T>
137 template <
typename Function,
typename Handler,
typename T>
147 #if !defined(GENERATING_DOCUMENTATION) 149 template <
typename Handler,
typename ReturnType>
155 template <
typename Handler,
typename ReturnType,
typename Arg1>
161 template <
typename Handler,
typename ReturnType>
168 template <
typename Handler,
typename ReturnType,
typename Arg2>
175 template <
typename Handler,
typename T>
188 if (!out_ec_) h.
ec_ = &
ec_;
210 template <
typename Handler>
223 if (!out_ec_) h.
ec_ = &
ec_;
244 template <
typename Handler,
typename Function>
250 call_handler_(call_handler),
255 weak_ptr<typename basic_yield_context<Handler>::callee_type>
coro_;
261 template <
typename Handler,
typename Function>
266 shared_ptr<spawn_data<Handler, Function> > data(data_);
267 #if !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2) 269 #endif // !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2) 272 (data->function_)(yield);
273 if (data->call_handler_)
277 shared_ptr<spawn_data<Handler, Function> >
data_;
280 template <
typename Handler,
typename Function>
287 shared_ptr<callee_type> coro(
new callee_type(entry_point, attributes_));
292 shared_ptr<spawn_data<Handler, Function> >
data_;
300 template <
typename Handler,
typename Function>
303 const boost::coroutines::attributes& attributes)
314 template <
typename Handler,
typename Function>
317 const boost::coroutines::attributes& attributes)
329 template <
typename Function>
332 const boost::coroutines::attributes& attributes)
338 template <
typename Function>
341 const boost::coroutines::attributes& attributes)
347 #endif // !defined(GENERATING_DOCUMENTATION) 353 #endif // ASIO_IMPL_SPAWN_HPP shared_ptr< typename basic_yield_context< Handler >::callee_type > coro_
detail::coro_handler< Handler, Arg2 > type
void default_spawn_handler()
void asio_handler_deallocate(void *pointer, std::size_t size, binder1< Handler, Arg1 > *this_handler)
detail::coro_handler< Handler, void > type
boost::coroutines::attributes attributes_
Provides core I/O functionality.
async_result(detail::coro_handler< Handler, T > &h)
shared_ptr< typename basic_yield_context< Handler >::callee_type > coro_
void * asio_handler_allocate(std::size_t size, binder1< Handler, Arg1 > *this_handler)
detail::coro_handler< Handler, Arg1 > type
async_result(detail::coro_handler< Handler, void > &h)
void operator()(typename basic_yield_context< Handler >::caller_type &ca)
An interface for customising the behaviour of an initiating function.
Provides serialised handler execution.
coro_handler(basic_yield_context< Handler > ctx)
shared_ptr< spawn_data< Handler, Function > > data_
void invoke(Function &function, Context &context)
detail::coro_handler< Handler, void > type
shared_ptr< spawn_data< Handler, Function > > data_
boost::coroutines::coroutine< void()> callee_type
The coroutine callee type, used by the implementation.
void operator()(asio::error_code ec, T value)
Context object the represents the currently executing coroutine.
void asio_handler_invoke(Function &function, binder1< Handler, Arg1 > *this_handler)
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
Class to represent an error code value.
void deallocate(void *p, std::size_t s, Handler &h)
spawn_data(ASIO_MOVE_ARG(Handler) handler, bool call_handler, ASIO_MOVE_ARG(Function) function)
coro_handler(basic_yield_context< Handler > ctx)
void spawn(ASIO_MOVE_ARG(Handler) handler, ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes &attributes)
basic_yield_context< Handler >::caller_type & ca_
weak_ptr< typename basic_yield_context< Handler >::callee_type > coro_
detail::wrapped_handler< strand, Handler, detail::is_continuation_if_running > wrap(Handler handler)
void * allocate(std::size_t s, Handler &h)
void operator()(asio::error_code ec)
#define ASIO_MOVE_CAST(type)
bool asio_handler_is_continuation(binder1< Handler, Arg1 > *this_handler)
Default handler type traits provided for all handlers.
boost::coroutines::coroutine< void()>::caller_type caller_type
The coroutine caller type, used by the implementation.
basic_yield_context< Handler >::caller_type & ca_