File indexing completed on 2026-08-17 08:50:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_MSM_BACKMP11_DISPATCH_TABLE_H
0013 #define BOOST_MSM_BACKMP11_DISPATCH_TABLE_H
0014
0015 #include <cstdint>
0016 #include <cstddef>
0017
0018 #include <boost/mp11.hpp>
0019 #include <boost/msm/backmp11/common_types.hpp>
0020
0021 namespace boost { namespace msm { namespace backmp11
0022 {
0023
0024 namespace detail
0025 {
0026
0027
0028 template<typename Cell>
0029 struct init_cell_value
0030 {
0031 size_t index;
0032 Cell address;
0033 };
0034 template<size_t v1, typename Cell, Cell v2>
0035 struct init_cell_constant
0036 {
0037 static constexpr init_cell_value<Cell> value = {v1, v2};
0038 };
0039
0040
0041 typedef std::uintptr_t generic_cell;
0042 struct generic_init_cell_value
0043 {
0044 size_t index;
0045 generic_cell address;
0046 };
0047
0048
0049 template<typename Cell, typename InitCellConstants, std::size_t... I>
0050 static const init_cell_value<Cell>* get_init_cells_impl(mp11::index_sequence<I...>)
0051 {
0052 static constexpr init_cell_value<Cell> values[] {mp11::mp_at_c<InitCellConstants, I>::value...};
0053 return values;
0054 }
0055 template<typename Cell, typename InitCellConstants>
0056 static const init_cell_value<Cell>* get_init_cells_impl(mp11::index_sequence<>)
0057 {
0058 return nullptr;
0059 }
0060 template<typename Cell, typename InitCellConstants>
0061 static const generic_init_cell_value* get_init_cells()
0062 {
0063 return reinterpret_cast<const generic_init_cell_value*>(
0064 get_init_cells_impl<Cell, InitCellConstants>(mp11::make_index_sequence<mp11::mp_size<InitCellConstants>::value>{}));
0065 }
0066
0067 }
0068
0069 }}}
0070
0071 #endif