Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] Pass event data to state constructor?
From: Bill Clark (bill_at_[hidden])
Date: 2009-09-02 16:35:23


Hi Andreas,

In the scenario I'm thinking of, we have an event which says "data is
available" from a data source. We don't want to put the data itself in the
event, because it's very large and/or very expensive to obtain, and it might
or might not be of interest. Instead, the event contains a token that can be
used to request the data if it turns out to be needed. So on receipt of that
"data is available" event, we'll transition to a new state that can
determine whether it needs to obtain the data or not, and if so, to use the
token to get it. But as it stands now, the new state doesn't have access to
the token.

In the meantime, what would be a good way to approach this? The only option
I can think of is to save the token somewhere so the destination state can
get it.

Thanks,
Bill

On Wed, Sep 2, 2009 at 11:47 AM, Andreas Huber <
ahd6974-spamboostorgtrap_at_[hidden]> wrote:

> Hi Bill
>
> I'd like to be able to communicate the data from an event to the state(s)
>> that get constructed as a result of a transition.
>>
>
> That's a pretty common request, see item 3 on the to-do list:
>
> http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList
>
> As stated in the todo-item, passing event data to the state constructor is
> not as straight-forward as it might seem. You are bound to lose event
> type-safety. However, if you have a compelling use-case, I'm willing to
> finally implement this feature.
>
> HTH & Regards,
>
> --
> Andreas Huber
>
> When replying by private email, please remove the words spam and trap
> from the address shown in the header.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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