123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- #ifndef BOOST_MYSQL_STATIC_EXECUTION_STATE_HPP
- #define BOOST_MYSQL_STATIC_EXECUTION_STATE_HPP
- #include <boost/mysql/detail/config.hpp>
- #ifdef BOOST_MYSQL_CXX14
- #include <boost/mysql/metadata.hpp>
- #include <boost/mysql/metadata_collection_view.hpp>
- #include <boost/mysql/string_view.hpp>
- #include <boost/mysql/detail/access.hpp>
- #include <boost/mysql/detail/execution_processor/static_execution_state_impl.hpp>
- namespace boost {
- namespace mysql {
- template <class... StaticRow>
- class static_execution_state
- {
- public:
-
- static_execution_state() = default;
-
- static_execution_state(const static_execution_state& other) = default;
-
- static_execution_state(static_execution_state&& other) = default;
-
- static_execution_state& operator=(const static_execution_state& other) = default;
-
- static_execution_state& operator=(static_execution_state&& other) = default;
-
- bool should_start_op() const noexcept { return impl_.get_interface().is_reading_first(); }
-
- bool should_read_head() const noexcept { return impl_.get_interface().is_reading_first_subseq(); }
-
- bool should_read_rows() const noexcept { return impl_.get_interface().is_reading_rows(); }
-
- bool complete() const noexcept { return impl_.get_interface().is_complete(); }
-
- metadata_collection_view meta() const noexcept { return impl_.get_interface().meta(); }
-
- std::uint64_t affected_rows() const noexcept { return impl_.get_interface().get_affected_rows(); }
-
- std::uint64_t last_insert_id() const noexcept { return impl_.get_interface().get_last_insert_id(); }
-
- unsigned warning_count() const noexcept { return impl_.get_interface().get_warning_count(); }
-
- string_view info() const noexcept { return impl_.get_interface().get_info(); }
-
- bool is_out_params() const noexcept { return impl_.get_interface().get_is_out_params(); }
- private:
- detail::static_execution_state_impl<StaticRow...> impl_;
- static_assert(sizeof...(StaticRow) > 0, "static_execution_state requires one row type, at least");
- #ifndef BOOST_MYSQL_DOXYGEN
- friend struct detail::access;
- #endif
- };
- }
- }
- #endif
- #endif
|