include/boost/capy/asio/detail/asio_context_service.hpp

100.0% Lines (3/3) 100.0% List of functions (4/4)
asio_context_service.hpp
f(x) Functions (4)
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Vinnie Falco (vinnie.falco@gmail.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/capy
8 //
9
10 #ifndef BOOST_CAPY_ASIO_DETAIL_ASIO_CONTEXT_SERVICE
11 #define BOOST_CAPY_ASIO_DETAIL_ASIO_CONTEXT_SERVICE
12
13 #include <boost/capy/ex/execution_context.hpp>
14
15 namespace boost::capy::detail
16 {
17
18 template<typename Context>
19 struct asio_context_service
20 : Context::service
21 , capy::execution_context
22 {
23 static Context::id id;
24
25 3x asio_context_service(Context & ctx)
26 3x : Context::service(ctx) {}
27 6x void shutdown() override {capy::execution_context::shutdown();}
28 };
29
30
31 // asio_context_service is templated for this id.
32 template<typename Context>
33 Context::id asio_context_service<Context>::id;
34
35 }
36
37 #endif
38
39