Boost logo

Boost :

Subject: Re: [boost] boost [msm] deferring event by base type.
From: Richard Szabo (sz.richard_at_[hidden])
Date: 2010-06-25 04:40:51


On 24 June 2010 22:56, Richard Szabo <sz.richard_at_[hidden]> wrote:
> On 24 June 2010 22:46, Juraj Ivančić <juraj.ivancic_at_[hidden]> wrote:
>> On 24.6.2010 22:02, Richard Szabo wrote:
>>>
>>> It would be nice to able to defer event by it's base types it would
>>> make code maintenance easier not have to declare all events one by one
>>> for deferring.
>>
>> Did you try activating deferred events and adding a 'Defer' row in the
>> transition table like described here
>
> No I did not try I will.

I'm now using Row and Defer functor I have now an other problem whit the :

    void defer_event(Event const& e)
    {
        // to call this function, you need either a state with a
deferred_events typedef
        // or that the fsm provides the activate_deferred_events typedef
        BOOST_MPL_ASSERT(( has_fsm_deferred_events<library_sm> ));
        execute_return (library_sm::*pf) (Event const& evt)=
&library_sm::process_event;
        Event temp (e);
        ::boost::function<execute_return () > f= ::boost::bind(pf, this,temp);
        post_deferred_event(f);
    }

actually it tries to instantiate the base class ( Event temp (e); )
but in my case the base class is an abstract class -> compiler error;
and after deferring I want to dispatch the original derived event not
the copy constructed base class instance of the event.

>
> Thanks for the tipp.
>>
>> http://tinyurl.com/36sp4a8
>>
>> I think this will allow deferral by base type.
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk