"Andreas Huber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can find Aleksey's fsm lib here: > > http://www.mywikinet.com/mpl/fsm_example_25_jul_02.zip > > In my library, you can look for simple_state::react_impl() which is the > override for the abstract state_base::react_impl(). The implementation is > quite simple: all reactions are contained in an mpl::list, which is passed > to a function. The function then calls the front reaction. If the reaction > returns that there was a match the result is returned. Otherwise, the > function calls itself again with the front of the list removed. Of course, > there is a specialisation for an empty list which does nothing.
Exactly what i was looking for. Thanks. > BTW, this double dispatch variant is only "cool" ;-) for cases where the > second stage of the double dispatch has to choose from only a few different > possibilities. That's because the second stage performs a linear search. Second stage means inner states ? > In > contrast to GOF-visitor, which is essentially constant-time, this variant > becomes slower the more choices it has in the second stage. But it scales > much better in terms of dependencies. Does it mean that for some use cases your lib can be event slower than FSM implementation with acyclic visitor ? IMHO inner states are not too rare thing in practice ... regars, bohdan _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost