ゴミ箱
Public Types | Public Member Functions | Public Attributes | List of all members
boost::beast::async_completion< CompletionToken, Signature > Struct Template Reference

#include <async_result.hpp>

Public Types

using completion_handler_type = typename async_result< typename std::decay< CompletionToken >::type, Signature >::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
 The final completion handler, callable with the specified signature. More...
 
async_result< typename std::decay< CompletionToken >::type, Signature > result
 The return value of the asynchronous initiation function. More...
 

Detailed Description

template<class CompletionToken, class Signature>
struct boost::beast::async_completion< CompletionToken, Signature >

Helper for customizing the return type of asynchronous initiation functions.

This class template is used to transform caller-provided completion handlers in calls to asynchronous initiation functions. The transformation allows customization of the return type of the initiating function, and the function signature of the final handler.

Example:

...
template<class CompletionToken>
typename async_completion<CompletionToken, void(error_code)>::result_type
async_initfn(..., CompletionToken&& handler)
{
async_completion<CompletionToken, void(error_code)> completion{handler};
...
return completion.result.get();
}
Template Parameters
CompletionTokenSpecifies the model used to obtain the result of the asynchronous operation.
SignatureThe call signature for the completion handler type invoked on completion of the asynchronous operation.
Note
See Working Draft, C++ Extensions for Networking
See also
async_return_type, handler_type

Member Typedef Documentation

template<class CompletionToken , class Signature >
using boost::beast::async_completion< CompletionToken, Signature >::completion_handler_type = typename async_result< typename std::decay<CompletionToken>::type, Signature>::completion_handler_type

The type of the final handler called by the asynchronous initiation function.

Objects of this type will be callable with the specified signature.

Constructor & Destructor Documentation

template<class CompletionToken , class Signature >
boost::beast::async_completion< CompletionToken, Signature >::async_completion ( CompletionToken &  token)
inlineexplicit

Constructor

The constructor creates the concrete completion handler and makes the link between the handler and the asynchronous result.

Parameters
tokenThe completion token. If this is a regular completion handler, copies may be made as needed. If the handler is movable, it may also be moved.

Member Data Documentation

template<class CompletionToken , class Signature >
std::conditional<std::is_same< CompletionToken, completion_handler_type>::value, completion_handler_type&, completion_handler_type >::type boost::beast::async_completion< CompletionToken, Signature >::completion_handler

The final completion handler, callable with the specified signature.

template<class CompletionToken , class Signature >
async_result<typename std::decay< CompletionToken>::type, Signature> boost::beast::async_completion< CompletionToken, Signature >::result

The return value of the asynchronous initiation function.


The documentation for this struct was generated from the following file: