Index: state_machine.hpp =================================================================== --- state_machine.hpp (revision 78630) +++ state_machine.hpp (working copy) @@ -63,6 +63,8 @@ #include #include +#include + BOOST_MPL_HAS_XXX_TRAIT_DEF(accept_sig) BOOST_MPL_HAS_XXX_TRAIT_DEF(no_automatic_create) BOOST_MPL_HAS_XXX_TRAIT_DEF(non_forwarding_flag) @@ -2511,10 +2513,12 @@ self->internal_start(evt.m_event); } - // this variant is for the pseudo state entry case + // this variant is for the pseudo state entry case (EventType == msm::none) template typename ::boost::enable_if< - typename is_pseudo_entry::type,void + typename ::boost::mpl::and_< + typename is_pseudo_entry::type, + typename ::boost::is_same::type>::type, void >::type operator()(EventType const& evt,FsmType& fsm, ::boost::msm::back::dummy<3> = 0) { @@ -2526,10 +2530,30 @@ // given region starts with the entry pseudo state as active state self->m_states[find_region_id::region_index] = state_id; self->internal_start(evt.m_event); + } + + // this variant is for the pseudo state entry case (EventType != msm::none) + template + typename ::boost::enable_if< + typename ::boost::mpl::and_< + typename is_pseudo_entry::type, + typename ::boost::mpl::not_< typename ::boost::is_same::type>::type>::type, void + >::type + operator()(EventType const& evt,FsmType& fsm, ::boost::msm::back::dummy<3> = 0) + { + // entry on the FSM + (static_cast(self))->on_entry(evt,fsm); + int state_id = get_state_id::value; + BOOST_STATIC_ASSERT(find_region_id::region_index >= 0); + BOOST_STATIC_ASSERT(find_region_id::region_index < nr_regions::value); + // given region starts with the entry pseudo state as active state + self->m_states[find_region_id::region_index] = state_id; + self->internal_start(evt.m_event); // and we process the transition in the zone of the newly active state // (entry pseudo states are, according to UML, a state connecting 1 transition outside to 1 inside self->process_event(evt.m_event); } + private: // helper for the fork case, does almost like the direct entry library_sm* self;