
Johan Nilsson wrote:
Hi,
I'm implementing an asynchronous state machine and have problems with events not being dispatched. All event thrown at the fsm are dispatched to the unhandled_event method.
When debugging the problem, I used typeid on the event to see that the expected events were generated (they were) from the event dispatch threads. After this, I tried to get the current state from within the unhandled_event() method - but to my surprise the statement "this->state_begin() != this->state_end()" is never satisfied. Looks like there's no current state.
Well, isn't it weird that as soon as one asks for help, you find the problem yourself. I'd just forgot the call to fifo_scheduler<>::initiate_processor in the application. Doh! Would it be possible to check if the processor has been initiated when calling "scheduler::operator()"? I don't think it would be a huge overhead as this operator is called quite infrequently (only once per app invocation in my case). At least, adding an assertion in debug builds would be of great help. Andreas? Thanks // Johan