trac 9280: moved handling of deferred events to history policy

[SVN r86799]
This commit is contained in:
Christophe Henry 2013-11-23 20:49:36 +00:00
parent fa9b3442fc
commit 0b7c69204c
2 changed files with 24 additions and 0 deletions

View File

@ -49,6 +49,12 @@ public:
}
return *this;
}
// this policy deletes all waiting deferred events
template <class Event>
bool process_deferred_events(Event const&)const
{
return false;
}
template<class Archive>
void serialize(Archive & ar, const unsigned int)
{
@ -90,6 +96,13 @@ public:
}
return *this;
}
// the history policy keeps all deferred events until next reentry
template <class Event>
bool process_deferred_events(Event const&)const
{
return true;
}
template<class Archive>
void serialize(Archive & ar, const unsigned int)
{
@ -139,6 +152,12 @@ public:
}
return *this;
}
// the history policy keeps deferred events until next reentry if coming from our history event
template <class Event>
bool process_deferred_events(Event const&)const
{
return ::boost::mpl::contains<Events,Event>::value;
}
template<class Archive>
void serialize(Archive & ar, const unsigned int)
{

View File

@ -2614,6 +2614,11 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
(static_cast<Derived*>(this))->on_exit(incomingEvent,fsm);
// give the history a chance to handle this (or not).
m_history.history_exit(this->m_states);
// history decides what happens with deferred events
if (!m_history.process_deferred_events(incomingEvent))
{
get_deferred_queue().clear();
}
}
// the IBM and VC<8 compilers seem to have problems with the friend declaration of dispatch_table