12 template <
typename SM,
typename SM::StateEnum s1,
typename SM::StateEnum s2>
14 template <
typename SM,
typename SM::StateEnum s>
17 template <
class... Conditions>
20 template <
class Condition,
class... Conditions>
21 struct Or<Condition, Conditions...>
22 : std::conditional<Condition::value, std::true_type, Or<Conditions...>>::
32 template <
typename SM::StateEnum to>
36 CHECK_EQ(stateStruct.state(),
state);
38 stateStruct.state() =
to;
42 template <
typename SM,
typename SM::StateEnum state,
typename SM::Event event>
48 return SM::InvalidEventHandler(curState, event,
std::move(param));
52 #define FIZZ_DECLARE_EVENT_HANDLER(sm, statename, eventname, ...) \ 54 class EventHandler<sm, statename, eventname> \ 55 : public EventHandlerBase<sm, statename, eventname, __VA_ARGS__> { \ 57 static typename sm::Actions handle( \ 58 const typename sm::State&, \ 59 typename sm::Param param); \ 62 template <
typename SM>
66 static constexpr
auto handlers = getEventHandlers(
67 std::make_index_sequence<SM::NumStates * SM::NumEvents>());
68 const auto i =
static_cast<std::size_t
>(
state) * SM::NumEvents +
69 static_cast<std::size_t>(event);
70 CHECK_LT(
i, handlers.size()) <<
"Out of bounds handler requested";
74 template <
typename SM>
75 template <std::
size_t i>
81 static_cast<typename SM::Event>(
i % SM::NumEvents)>::handle;
static void Transition(typename SM::State &stateStruct)
folly::StringPiece toString(StateEnum state)
boost::variant< ClientHello, ServerHello, EndOfEarlyData, HelloRetryRequest, EncryptedExtensions, CertificateRequest, CompressedCertificate, CertificateMsg, CertificateVerify, Finished, NewSessionTicket, KeyUpdate, Alert, Accept, Connect, AppData, AppWrite, EarlyAppWrite, WriteNewSessionTicket > Param
constexpr detail::Map< Move > move
bool_constant< true > true_type
State
See Core for details.
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
std::vector< Action > Actions
static EventHandlerFun getHandler(typename SM::StateEnum state, typename SM::Event event)
static const char *const value
static SM::Actions handle(const typename SM::State &curState, typename SM::Param param)
static constexpr EventHandlerFun getEventHandler()
bool_constant< false > false_type
typename SM::Actions(*)(const typename SM::State &, typename SM::Param) EventHandlerFun