Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2008-06-20 15:47:08


"Felipe Magno de Almeida" <felipe.m.almeida_at_[hidden]> wrote in message
news:a2b17b60806200011o38365075ye9eb76a3ddc7fcd5_at_mail.gmail.com...
> On Fri, Jun 20, 2008 at 4:09 AM, Felipe Magno de Almeida
> <felipe.m.almeida_at_[hidden]> wrote:
>> On Thu, Jun 19, 2008 at 5:22 PM, Andreas Huber
>> <ahd6974-spamboostorgtrap_at_[hidden]> wrote:
>>> "Felipe Magno de Almeida" <felipe.m.almeida_at_[hidden]> wrote in message
>
> Sorry replying to myself, but I must correct somethings.
>
> [snip]
>
>> I was thinking more that boost.statechart would always use a functional
>> factory,
>> like boost::function<State*>() to instantiate states.

Which works for the construction of the destination state but not for the
construction of possibly also entered outer and inner states of the
destination state. For example, please have a look at the following chart:

<http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/LCA.gif>

During the transition triggered by the event Ev, the states X, Y and Z are
entered and thus constructed. IIUC, with your approach it is only possible
to pass arguments to the constructor of Y, but not to the ones of X and Z,
correct? The solution I have in mind (see code in previous post) would allow
you to selectively provide whatever arguments you might want to pass to X, Y
and/or Z. Admittedly, passing arguments to outer and inner states of the
destination might be a less frequent use case but I'd still rather not rule
it out.

Thoughts?

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

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