Boost logo

Boost Users :

Subject: [Boost-users] [MSM] Problem with passing event as a reference to base event class
From: samriti katoch (angelic.sam_at_[hidden])
Date: 2013-07-03 15:40:40


Hi,

I have noticed a strange problem with event processing with msm.
My events derive publicly from a base events struct like this:

struct BaseEvent { virtual ~BaseEvent() {} };
struct ConcreteEvent : public BaseEvent {};

I my FSM i have a transition defined for ConcreteEvent,

When I do this :

void foo(const BuddyEvent& event)
{
       fsm->process_event(event); // event is of type ConcreteEvent
}

The fsm fires a no_transition , and I see a message saying no transition
for ConcreteEvent in state X (state X has a valid transition for
ConcreteEvent)

However this succeeds:
void foo(const BuddyEvent& event)
{
       fsm->process_event(ConcreteEvent(0);
}

I am using boost-1.49 and the boost msm library that comes bundled with
this.

So my question is, why is msm not able to generate a valid transition for a
concrete event passed as a reference to its base tyoe.

Thanks!



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