Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:41:03

0001 //
0002 // Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MYSQL_DETAIL_EXECUTION_CONCEPTS_HPP
0009 #define BOOST_MYSQL_DETAIL_EXECUTION_CONCEPTS_HPP
0010 
0011 #include <boost/mysql/string_view.hpp>
0012 
0013 #include <boost/mysql/detail/any_execution_request.hpp>
0014 #include <boost/mysql/detail/config.hpp>
0015 
0016 #include <type_traits>
0017 
0018 #ifdef BOOST_MYSQL_HAS_CONCEPTS
0019 
0020 namespace boost {
0021 namespace mysql {
0022 
0023 // Forward decls
0024 template <class... StaticRow>
0025 class static_execution_state;
0026 
0027 template <class... StaticRow>
0028 class static_results;
0029 
0030 class execution_state;
0031 class results;
0032 
0033 namespace detail {
0034 
0035 // Execution state
0036 template <class T>
0037 struct is_static_execution_state : std::false_type
0038 {
0039 };
0040 
0041 template <class... T>
0042 struct is_static_execution_state<static_execution_state<T...>> : std::true_type
0043 {
0044 };
0045 
0046 template <class T>
0047 concept execution_state_type = std::is_same_v<T, execution_state> || is_static_execution_state<T>::value;
0048 
0049 // Results
0050 template <class T>
0051 struct is_static_results : std::false_type
0052 {
0053 };
0054 
0055 template <class... T>
0056 struct is_static_results<static_results<T...>> : std::true_type
0057 {
0058 };
0059 
0060 template <class T>
0061 concept results_type = std::is_same_v<T, results> || is_static_results<T>::value;
0062 
0063 // Execution request
0064 template <class T>
0065 struct is_execution_request
0066 {
0067     static constexpr bool value = !std::is_base_of<
0068         no_execution_request_traits,
0069         execution_request_traits<typename std::decay<T>::type>>::value;
0070 };
0071 
0072 template <class T>
0073 concept execution_request = is_execution_request<T>::value;
0074 
0075 }  // namespace detail
0076 }  // namespace mysql
0077 }  // namespace boost
0078 
0079 #define BOOST_MYSQL_EXECUTION_STATE_TYPE ::boost::mysql::detail::execution_state_type
0080 #define BOOST_MYSQL_RESULTS_TYPE ::boost::mysql::detail::results_type
0081 #define BOOST_MYSQL_EXECUTION_REQUEST ::boost::mysql::detail::execution_request
0082 
0083 #else
0084 
0085 #define BOOST_MYSQL_EXECUTION_STATE_TYPE class
0086 #define BOOST_MYSQL_RESULTS_TYPE class
0087 #define BOOST_MYSQL_EXECUTION_REQUEST class
0088 
0089 #endif
0090 
0091 #endif