Line data Source code
1 : //
2 : // Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com)
3 : //
4 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 : //
7 : // Official repository: https://github.com/cppalliance/beast2
8 : //
9 :
10 : #ifndef BOOST_BEAST2_SERVER_ROUTE_HANDLER_ASIO_HPP
11 : #define BOOST_BEAST2_SERVER_ROUTE_HANDLER_ASIO_HPP
12 :
13 : #include <boost/beast2/detail/config.hpp>
14 : #include <boost/http_proto/server/route_handler.hpp>
15 : #include <type_traits>
16 :
17 : namespace boost {
18 : namespace beast2 {
19 :
20 : /** Route parameters object for Asio HTTP route handlers
21 : */
22 : template<class AsyncStream>
23 : class asio_route_params
24 : : public http::route_params
25 : {
26 : public:
27 : using stream_type = typename std::decay<AsyncStream>::type;
28 :
29 : AsyncStream stream;
30 :
31 : template<class... Args>
32 : explicit
33 1 : asio_route_params(
34 : Args&&... args)
35 1 : : stream(std::forward<Args>(args)...)
36 : {
37 1 : }
38 :
39 : private:
40 : public:
41 : // VFALCO This needs to be private
42 0 : void do_finish()
43 : {
44 0 : if(finish_)
45 : {
46 0 : auto f = std::move(finish_);
47 0 : finish_ = {};
48 0 : f();
49 0 : }
50 0 : }
51 :
52 : };
53 :
54 : } // beast2
55 : } // boost
56 :
57 : #endif
|