Skip to content

Commit

Permalink
Remove deprecated handler invocation hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Oct 25, 2023
1 parent eae55c1 commit 944758c
Show file tree
Hide file tree
Showing 68 changed files with 20 additions and 1,428 deletions.
1 change: 0 additions & 1 deletion doc/quickref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
<member><link linkend="boost_asio.reference.experimental__make_parallel_group">experimental::make_parallel_group</link></member>
<member><link linkend="boost_asio.reference.asio_handler_allocate">asio_handler_allocate</link> (deprecated)</member>
<member><link linkend="boost_asio.reference.asio_handler_deallocate">asio_handler_deallocate</link> (deprecated)</member>
<member><link linkend="boost_asio.reference.asio_handler_invoke">asio_handler_invoke</link> (deprecated)</member>
<member><link linkend="boost_asio.reference.asio_handler_is_continuation">asio_handler_is_continuation</link></member>
<member><link linkend="boost_asio.reference.async_compose">async_compose</link></member>
<member><link linkend="boost_asio.reference.async_initiate">async_initiate</link></member>
Expand Down
1 change: 0 additions & 1 deletion include/boost/asio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
#include <boost/asio/generic/stream_protocol.hpp>
#include <boost/asio/handler_alloc_hook.hpp>
#include <boost/asio/handler_continuation_hook.hpp>
#include <boost/asio/handler_invoke_hook.hpp>
#include <boost/asio/high_resolution_timer.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/io_context_strand.hpp>
Expand Down
27 changes: 0 additions & 27 deletions include/boost/asio/compose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <boost/asio/detail/composed_work.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/type_traits.hpp>

#include <boost/asio/detail/push_options.hpp>
Expand Down Expand Up @@ -168,32 +167,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Impl,
typename Work, typename Handler, typename Signature>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
composed_op<Impl, Work, Handler, Signature>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Impl,
typename Work, typename Handler, typename Signature>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
composed_op<Impl, Work, Handler, Signature>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Signature, typename Executors>
class initiate_composed_op
{
Expand Down
175 changes: 0 additions & 175 deletions include/boost/asio/detail/bind_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <boost/asio/associator.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/type_traits.hpp>

#include <boost/asio/detail/push_options.hpp>
Expand Down Expand Up @@ -101,30 +100,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder0<Handler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder0<Handler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler>
inline binder0<decay_t<Handler>> bind_handler(
Handler&& handler)
Expand Down Expand Up @@ -212,30 +187,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder1<Handler, Arg1>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler, typename Arg1>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder1<Handler, Arg1>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1>
inline binder1<decay_t<Handler>, Arg1> bind_handler(
Handler&& handler, const Arg1& arg1)
Expand Down Expand Up @@ -330,30 +281,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1, typename Arg2>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder2<Handler, Arg1, Arg2>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler, typename Arg1, typename Arg2>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder2<Handler, Arg1, Arg2>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
inline binder2<decay_t<Handler>, Arg1, Arg2> bind_handler(
Handler&& handler, const Arg1& arg1, const Arg2& arg2)
Expand Down Expand Up @@ -455,32 +382,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler,
typename Arg1, typename Arg2, typename Arg3>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler,
typename Arg1, typename Arg2, typename Arg3>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline binder3<decay_t<Handler>, Arg1, Arg2, Arg3> bind_handler(
Handler&& handler, const Arg1& arg1, const Arg2& arg2,
Expand Down Expand Up @@ -593,32 +494,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline binder4<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4>
Expand Down Expand Up @@ -738,32 +613,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4, typename Arg5>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function& function,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4, typename Arg5>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(const Function& function,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline binder5<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4, Arg5>
Expand Down Expand Up @@ -836,18 +685,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function&& function,
move_binder1<Handler, Arg1>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
static_cast<Function&&>(function), this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
class move_binder2
{
Expand Down Expand Up @@ -914,18 +751,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}

template <typename Function, typename Handler, typename Arg1, typename Arg2>
inline asio_handler_invoke_is_deprecated
asio_handler_invoke(Function&& function,
move_binder2<Handler, Arg1, Arg2>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
static_cast<Function&&>(function), this_handler->handler_);
#if defined(BOOST_ASIO_NO_DEPRECATED)
return asio_handler_invoke_is_no_longer_used();
#endif // defined(BOOST_ASIO_NO_DEPRECATED)
}

} // namespace detail

template <template <typename, typename> class Associator,
Expand Down
3 changes: 1 addition & 2 deletions include/boost/asio/detail/blocking_executor_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/event.hpp>
#include <boost/asio/detail/fenced_block.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/mutex.hpp>
#include <boost/asio/detail/scheduler_operation.hpp>

Expand Down Expand Up @@ -92,7 +91,7 @@ class blocking_executor_op : public blocking_executor_op_base<Operation>
{
fenced_block b(fenced_block::half);
BOOST_ASIO_HANDLER_INVOCATION_BEGIN(());
boost_asio_handler_invoke_helpers::invoke(o->handler_, o->handler_);
static_cast<Handler&&>(o->handler_)();
BOOST_ASIO_HANDLER_INVOCATION_END;
}
}
Expand Down
3 changes: 1 addition & 2 deletions include/boost/asio/detail/executor_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/memory.hpp>

#include <boost/asio/detail/push_options.hpp>
Expand Down Expand Up @@ -111,7 +110,7 @@ class executor_function
// Make the upcall if required.
if (call)
{
boost_asio_handler_invoke_helpers::invoke(function, function);
static_cast<Function&&>(function)();
}
}

Expand Down
3 changes: 1 addition & 2 deletions include/boost/asio/detail/executor_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/fenced_block.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/scheduler_operation.hpp>

#include <boost/asio/detail/push_options.hpp>
Expand Down Expand Up @@ -68,7 +67,7 @@ class executor_op : public Operation
{
fenced_block b(fenced_block::half);
BOOST_ASIO_HANDLER_INVOCATION_BEGIN(());
boost_asio_handler_invoke_helpers::invoke(handler, handler);
static_cast<Handler&&>(handler)();
BOOST_ASIO_HANDLER_INVOCATION_END;
}
}
Expand Down
Loading

0 comments on commit 944758c

Please sign in to comment.