From 7eee8f18753100428e25effea69151b9256f1d87 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Wed, 25 Feb 2015 07:41:22 +0100 Subject: [PATCH] Add support for custom handler tracking. --- asio/include/asio/detail/handler_tracking.hpp | 18 ++++++++++++++++-- .../asio/detail/impl/handler_tracking.ipp | 6 +++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/asio/include/asio/detail/handler_tracking.hpp b/asio/include/asio/detail/handler_tracking.hpp index 14e81771..4c3bdd7c 100644 --- a/asio/include/asio/detail/handler_tracking.hpp +++ b/asio/include/asio/detail/handler_tracking.hpp @@ -17,7 +17,9 @@ #include "asio/detail/config.hpp" -#if defined(ASIO_ENABLE_HANDLER_TRACKING) +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) +# include ASIO_CUSTOM_HANDLER_TRACKING +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) # include "asio/error_code.hpp" # include "asio/detail/cstdint.hpp" # include "asio/detail/static_mutex.hpp" @@ -29,7 +31,19 @@ namespace asio { namespace detail { -#if defined(ASIO_ENABLE_HANDLER_TRACKING) +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) + +// The user-specified header must define the following macros: +// - ASIO_INHERIT_TRACKED_HANDLER +// - ASIO_ALSO_INHERIT_TRACKED_HANDLER +// - ASIO_HANDLER_TRACKING_INIT +// - ASIO_HANDLER_CREATION(args) +// - ASIO_HANDLER_COMPLETION(args) +// - ASIO_HANDLER_INVOCATION_BEGIN(args) +// - ASIO_HANDLER_INVOCATION_END +// - ASIO_HANDLER_OPERATION(args) + +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) class handler_tracking { diff --git a/asio/include/asio/detail/impl/handler_tracking.ipp b/asio/include/asio/detail/impl/handler_tracking.ipp index 29fbe515..a06040e7 100644 --- a/asio/include/asio/detail/impl/handler_tracking.ipp +++ b/asio/include/asio/detail/impl/handler_tracking.ipp @@ -17,7 +17,11 @@ #include "asio/detail/config.hpp" -#if defined(ASIO_ENABLE_HANDLER_TRACKING) +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) + +// The handler tracking implementation is provided by the user-specified header. + +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) #include #include