// Copyright 2010 Christophe Henry // henry UNDERSCORE christophe AT hotmail DOT com // This is an extended version of the state machine available in the boost::mpl library // Distributed under the same license as the original. // Copyright for the original version: // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed // under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // back-end // set_states API is not supported by backmp11 #define BOOST_MSM_TEST_SKIP_BACKMP11 #include "BackCommon.hpp" //front-end #include #include #ifndef BOOST_MSM_NONSTANDALONE_TEST #define BOOST_TEST_MODULE set_states_test #endif #include namespace msm = boost::msm; namespace mpl = boost::mpl; using namespace msm::front; namespace { struct InputEvent {}; struct ExitEvent { ExitEvent() = default; template ExitEvent(const T&) {}; }; struct State : public boost::msm::front::state<> { template void on_entry(Event const&, FSM&) { std::cout << "State - on_entry" << "\n"; }; template void on_exit(Event const&, FSM&) { std::cout << "State - on_exit" << "\n"; } }; struct TerminateState : public boost::msm::front::terminate_state<> { template void on_entry(Event const&, FSM&) { std::cout << "TerminateState - on_entry" << "\n"; }; template void on_exit(Event const&, FSM&) { std::cout << "TerminateState - on_exit" << "\n"; } }; struct PseudoExitState : public boost::msm::front::exit_pseudo_state { }; template