Eliminate some unnecessary handler copies.

This commit is contained in:
Christopher Kohlhoff 2013-09-15 10:46:52 +10:00
parent 93ed48b0a3
commit a482f2d091
3 changed files with 13 additions and 13 deletions

View File

@ -197,7 +197,7 @@ public:
template <typename ConstBufferSequence, typename Handler>
void async_send(base_implementation_type& impl,
const ConstBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
@ -221,7 +221,7 @@ public:
// Start an asynchronous wait until data can be sent without blocking.
template <typename Handler>
void async_send(base_implementation_type& impl, const null_buffers&,
socket_base::message_flags, Handler handler)
socket_base::message_flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
@ -268,7 +268,7 @@ public:
template <typename MutableBufferSequence, typename Handler>
void async_receive(base_implementation_type& impl,
const MutableBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
@ -296,7 +296,7 @@ public:
// Wait until data can be received without blocking.
template <typename Handler>
void async_receive(base_implementation_type& impl, const null_buffers&,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
@ -353,7 +353,7 @@ public:
template <typename MutableBufferSequence, typename Handler>
void async_receive_with_flags(base_implementation_type& impl,
const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
socket_base::message_flags& out_flags, Handler handler)
socket_base::message_flags& out_flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
@ -380,7 +380,7 @@ public:
template <typename Handler>
void async_receive_with_flags(base_implementation_type& impl,
const null_buffers&, socket_base::message_flags in_flags,
socket_base::message_flags& out_flags, Handler handler)
socket_base::message_flags& out_flags, Handler& handler)
{
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);

View File

@ -214,7 +214,7 @@ public:
template <typename ConstBufferSequence, typename Handler>
void async_send(base_implementation_type& impl,
const ConstBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
@ -237,7 +237,7 @@ public:
// Start an asynchronous wait until data can be sent without blocking.
template <typename Handler>
void async_send(base_implementation_type& impl, const null_buffers&,
socket_base::message_flags, Handler handler)
socket_base::message_flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_null_buffers_op<Handler> op;
@ -281,7 +281,7 @@ public:
template <typename MutableBufferSequence, typename Handler>
void async_receive(base_implementation_type& impl,
const MutableBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_socket_recv_op<MutableBufferSequence, Handler> op;
@ -304,7 +304,7 @@ public:
// Wait until data can be received without blocking.
template <typename Handler>
void async_receive(base_implementation_type& impl, const null_buffers&,
socket_base::message_flags flags, Handler handler)
socket_base::message_flags flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_null_buffers_op<Handler> op;
@ -355,7 +355,7 @@ public:
template <typename MutableBufferSequence, typename Handler>
void async_receive_with_flags(base_implementation_type& impl,
const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
socket_base::message_flags& out_flags, Handler handler)
socket_base::message_flags& out_flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_socket_recvmsg_op<MutableBufferSequence, Handler> op;
@ -378,7 +378,7 @@ public:
template <typename Handler>
void async_receive_with_flags(base_implementation_type& impl,
const null_buffers&, socket_base::message_flags in_flags,
socket_base::message_flags& out_flags, Handler handler)
socket_base::message_flags& out_flags, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef win_iocp_null_buffers_op<Handler> op;

View File

@ -129,7 +129,7 @@ public:
/// Start an asynchronous wait.
template <typename Handler>
void async_wait(implementation_type& impl, Handler handler)
void async_wait(implementation_type& impl, Handler& handler)
{
// Allocate and construct an operation to wrap the handler.
typedef wait_handler<Handler> op;