| 1 | // |
| 2 | // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 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 | |
| 8 | #ifndef BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_TRACKER_EXECUTOR_HPP |
| 9 | #define BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_TRACKER_EXECUTOR_HPP |
| 10 | |
| 11 | #include <boost/asio/any_io_executor.hpp> |
| 12 | |
| 13 | #include <cstddef> |
| 14 | |
| 15 | namespace boost { |
| 16 | namespace mysql { |
| 17 | namespace test { |
| 18 | |
| 19 | struct executor_info |
| 20 | { |
| 21 | std::size_t num_posts{}; |
| 22 | std::size_t num_dispatches{}; |
| 23 | |
| 24 | std::size_t total() const noexcept { return num_dispatches + num_posts; } |
| 25 | }; |
| 26 | |
| 27 | asio::any_io_executor create_tracker_executor(asio::any_io_executor inner, executor_info* tracked_values); |
| 28 | executor_info get_executor_info(const asio::any_io_executor& exec); |
| 29 | |
| 30 | } // namespace test |
| 31 | } // namespace mysql |
| 32 | } // namespace boost |
| 33 | |
| 34 | #endif |
| 35 | |