Asio Extensions
Additional functionality built on top of (Boost.)Asio
asioext::async_completion< CompletionToken, Signature > Struct Template Reference

#include <asioext/async_result.hpp>

Public Types

typedef async_result< typename std::decay< CompletionToken >::type, Signature > result_type
 
typedef result_type::completion_handler_type completion_handler_type
 

Public Member Functions

 async_completion (CompletionToken &token)
 

Public Attributes

std::conditional< std::is_same< CompletionToken, completion_handler_type >::value, completion_handler_type &, completion_handler_type >::type completion_handler
 
result_type result
 

Detailed Description

template<typename CompletionToken, typename Signature>
struct asioext::async_completion< CompletionToken, Signature >

Helper template to deduce the handler type from a CompletionToken, capture a local copy of the handler, and then create an async_result for the handler.

Note
This type is the same as asio::async_completion if Asio 1.11.0+ is used. For prior versions this is a compatibility type that uses async_result to obtain the needed types.

Member Typedef Documentation

◆ completion_handler_type

template<typename CompletionToken , typename Signature >
typedef result_type::completion_handler_type asioext::async_completion< CompletionToken, Signature >::completion_handler_type

◆ result_type

template<typename CompletionToken , typename Signature >
typedef async_result< typename std::decay<CompletionToken>::type, Signature > asioext::async_completion< CompletionToken, Signature >::result_type

Constructor & Destructor Documentation

◆ async_completion()

template<typename CompletionToken , typename Signature >
asioext::async_completion< CompletionToken, Signature >::async_completion ( CompletionToken &  token)
inlineexplicit

Member Data Documentation

◆ completion_handler

template<typename CompletionToken , typename Signature >
std::conditional< std::is_same<CompletionToken, completion_handler_type>::value, completion_handler_type&, completion_handler_type >::type asioext::async_completion< CompletionToken, Signature >::completion_handler

◆ result

template<typename CompletionToken , typename Signature >
result_type asioext::async_completion< CompletionToken, Signature >::result