Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] "favor_compile_time" policy disables"kleene" events. (Bug?)
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2013-02-27 11:42:18


> it turns out my answer was incorrect, or at least incomplete. If you have
> no submachine, then there might be a way around.
> If you write: p.process_event(pause); where pause is an eUML event, true,
> it cannot work.
> However, this works:
> any_number_event evpause(pause);
> p.process_event(evpause);

I forgot to add the definition of any:number_event as it was in another
thread:

BOOST_TYPE_ERASURE_MEMBER((has_getNumber), getNumber, 0);
//type erasure event
typedef ::boost::mpl::vector<
    has_getNumber<int(), const boost::type_erasure::_self>,
    boost::type_erasure::relaxed_match,
    boost::type_erasure::copy_constructible<>,
    boost::type_erasure::typeid_<>
> any_number_event_concept;
struct any_number_event :
boost::type_erasure::any<any_number_event_concept>,
                            msm::front::euml::euml_event<any_number_event>
{
    template <class U>
    any_number_event(U const& u):
boost::type_erasure::any<any_number_event_concept> (u){}
    any_number_event(): boost::type_erasure::any<any_number_event_concept>
(){}
};

Used like this:
namespace boost { namespace msm{
    template<>
    struct is_kleene_event< any_number_event >
    {
        typedef boost::mpl::true_ type;
    };
}}

any_number_event number_event;

stt:
Playing + number_event / pause_playback == Paused


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net