pipeline.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_PIPELINE_HPP
  8. #define BOOST_MYSQL_DETAIL_PIPELINE_HPP
  9. #include <boost/mysql/character_set.hpp>
  10. #include <boost/mysql/detail/resultset_encoding.hpp>
  11. #include <cstddef>
  12. #include <cstdint>
  13. namespace boost {
  14. namespace mysql {
  15. namespace detail {
  16. class execution_processor;
  17. enum class pipeline_stage_kind
  18. {
  19. execute,
  20. prepare_statement,
  21. close_statement,
  22. reset_connection,
  23. set_character_set,
  24. ping,
  25. };
  26. struct pipeline_request_stage
  27. {
  28. pipeline_stage_kind kind;
  29. std::uint8_t seqnum;
  30. union stage_specific_t
  31. {
  32. std::nullptr_t nothing;
  33. resultset_encoding enc;
  34. character_set charset;
  35. stage_specific_t() noexcept : nothing() {}
  36. stage_specific_t(resultset_encoding v) noexcept : enc(v) {}
  37. stage_specific_t(character_set v) noexcept : charset(v) {}
  38. } stage_specific;
  39. };
  40. } // namespace detail
  41. } // namespace mysql
  42. } // namespace boost
  43. #endif