From 2d04fc4641684a9c81b31a95ec2b86eaa181975b Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 18 Aug 2013 02:29:48 -0700 Subject: [PATCH] Remove obsolete handler wrappers --- .../beast_asio/basics/beast_HandlerCall.h | 200 +++++++----------- .../handshake/beast_HandshakeDetectStream.h | 94 +------- .../beast_asio/sockets/beast_Socket.cpp | 72 +++---- .../modules/beast_asio/sockets/beast_Socket.h | 36 ++-- .../beast_asio/sockets/beast_SocketWrapper.h | 158 +++++++------- .../streams/beast_PrefilledReadStream.h | 4 +- .../sockets/ripple_MultiSocketType.h | 104 ++++----- 7 files changed, 270 insertions(+), 398 deletions(-) diff --git a/Subtrees/beast/modules/beast_asio/basics/beast_HandlerCall.h b/Subtrees/beast/modules/beast_asio/basics/beast_HandlerCall.h index b7d1b407f4..050280ce18 100644 --- a/Subtrees/beast/modules/beast_asio/basics/beast_HandlerCall.h +++ b/Subtrees/beast/modules/beast_asio/basics/beast_HandlerCall.h @@ -156,15 +156,22 @@ public: HandlerCall will meet this requirement: CompletionHandler */ + /** @{ */ template - HandlerCall (BOOST_ASIO_MOVE_ARG(Handler) handler, Completion, - Context context = Context ()) - : m_call (construct ( - BOOST_ASIO_MOVE_CAST(Handler)(handler), - context)) + HandlerCall (Post, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (Context (), + BOOST_ASIO_MOVE_CAST(Handler)(handler))) { } + template + HandlerCall (Post, Context context, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (context, + BOOST_ASIO_MOVE_CAST(Handler)(handler))) + { + } + /** @} */ + /** Construct a HandlerCall with one bound parameter. Produce a CompletionHandler that includes one bound parameter. @@ -189,15 +196,22 @@ public: HandlerCall will meet this requirement: CompletionHandler */ + /** @{ */ template - HandlerCall (BOOST_ASIO_MOVE_ARG(Handler) handler, Arg1 arg1, Completion, - Context context = Context ()) - : m_call (construct ( - BOOST_ASIO_MOVE_CAST(Handler)(handler), - context, arg1)) + HandlerCall (Post, BOOST_ASIO_MOVE_ARG(Handler) handler, Arg1 arg1) + : m_call (construct (Context (), + BOOST_ASIO_MOVE_CAST(Handler)(handler), arg1)) { } + template + HandlerCall (Post, Context context, BOOST_ASIO_MOVE_ARG(Handler) handler, Arg1 arg1) + : m_call (construct (context, + BOOST_ASIO_MOVE_CAST(Handler)(handler), arg1)) + { + } + /** @} */ + /** Construct a HandlerCall with two bound parameters. Produce a CompletionHandler that includes two bound parameters. @@ -221,15 +235,22 @@ public: The HandlerCall will meet these requirements: CompletionHandler */ + /** @{ */ template - HandlerCall (BOOST_ASIO_MOVE_ARG(Handler) handler, - Arg1 arg1, Arg2 arg2, Completion, Context context = Context ()) - : m_call (construct ( - BOOST_ASIO_MOVE_CAST(Handler)(handler), - context, arg1, arg2)) + HandlerCall (Post, BOOST_ASIO_MOVE_ARG(Handler) handler, Arg1 arg1, Arg2 arg2) + : m_call (construct (Context (), + BOOST_ASIO_MOVE_CAST(Handler)(handler), arg1, arg2)) { } + template + HandlerCall (Post, Context context, BOOST_ASIO_MOVE_ARG(Handler) handler, Arg1 arg1, Arg2 arg2) + : m_call (construct (context, + BOOST_ASIO_MOVE_CAST(Handler)(handler), arg1, arg2)) + { + } + /** @} */ + /** Construct a HandlerCall from a handler that takes an error_code Handler must meet one of these requirements: @@ -244,15 +265,22 @@ public: ShutdownHandler HandshakeHandler */ + /** @{ */ template - HandlerCall (BOOST_ASIO_MOVE_ARG(Handler) handler, Error, - Context context = Context ()) - : m_call (construct ( - BOOST_ASIO_MOVE_CAST(Handler)(handler), - context)) + HandlerCall (Error, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (Context (), + BOOST_ASIO_MOVE_CAST(Handler)(handler))) { } + template + HandlerCall (Error, Context context, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (context, + BOOST_ASIO_MOVE_CAST(Handler)(handler))) + { + } + /** @} */ + /** Construct a HandlerCall from a handler that takes an error_code and std::size Handler must meet one of these requirements: @@ -265,15 +293,22 @@ public: WriteHandler BufferedHandshakeHandler */ + /** @{ */ template - HandlerCall (BOOST_ASIO_MOVE_ARG(Handler) handler, Transfer, - Context context = Context ()) - : m_call (construct ( - BOOST_ASIO_MOVE_CAST(Handler)(handler), - context)) + HandlerCall (Transfer, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (Context (), + BOOST_ASIO_MOVE_CAST(Handler)(handler))) { } + template + HandlerCall (Transfer, Context context, BOOST_ASIO_MOVE_ARG(Handler) handler) + : m_call (construct (context, + BOOST_ASIO_MOVE_CAST(Handler)(handler))) + { + } + /** @} */ + /** Copy construction and assignment. HandlerCall is a very lightweight object that holds a shared @@ -532,46 +567,41 @@ private: // ownership of the handler from the stack. template