engine.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #ifndef BOOST_MYSQL_DETAIL_ENGINE_HPP
  8. #define BOOST_MYSQL_DETAIL_ENGINE_HPP
  9. #include <boost/mysql/detail/any_resumable_ref.hpp>
  10. #include <boost/asio/any_completion_handler.hpp>
  11. #include <boost/asio/any_io_executor.hpp>
  12. namespace boost {
  13. namespace mysql {
  14. namespace detail {
  15. class engine
  16. {
  17. public:
  18. using executor_type = asio::any_io_executor;
  19. virtual ~engine() {}
  20. virtual executor_type get_executor() = 0;
  21. virtual bool supports_ssl() const = 0;
  22. virtual void set_endpoint(const void* endpoint) = 0;
  23. virtual void run(any_resumable_ref resumable, error_code& err) = 0;
  24. virtual void async_run(any_resumable_ref resumable, asio::any_completion_handler<void(error_code)>) = 0;
  25. };
  26. } // namespace detail
  27. } // namespace mysql
  28. } // namespace boost
  29. #endif