
On Wednesday 06 August 2008 1:18:33 pm Andrey Semashev wrote:
Chris Knight wrote:
template< typename T > void on_process(T const&);
void on_process_dynamic(base_event const& base) { base->some_virtual(); // or m_events[base->id].some_non_virtual(); }
My only point was that with a little bit of help from the library, implementing dynamic/defferred event processing should be possible.
Sorry, I still don't get it. You already can pass events with virtual functions and process them through base classes. The main problem with deferred events is that there's nobody to call process(deferred_event) of the FSM. Another problem is that you generally don't know the complete FSM type in states or transitions, but this issue is solvable with a change in the state and transition base classes.
Could you elaborate your point, please?
I think you basically have it. I agree that the deferred event processing while (events_to_process) { fsm.process_dynamic(event); } shouldn't be included in boost.FSM, the process_dynamic(event_c& const) function should be. Using the TagV in the event_c class, it should be possible to provide a member function in state_machine to process events given only a reference to the event_c base class and that calls the appropriate process(event& const) via dispatching on the integer TagV. I'm trying to figure out whether this would be a simple feature addition or there is some critical piece I am missing. Chris