I have a state machine that has a large number of event types but only a few different states. Some of the events can be received regardless of the state and the same action is taken regardless of which state the machine is in, so the event is really unrelated to the state. I there an efficient way of handling the events that are state independent rather than defining a transition from every possible state for each state independent event?

 

A number of the events do transition the state machine and depend on the current state, so a transition is necessary. But if no state change is required for the event and the current state is not important, I’m not sure how to define event handling without defining a transition from all possible states. This winds up creating a much larger number of transitions than I really need, and a much longer compile time than I would like. I am looking for some way to handle these states that would still give me good run time speed, put not pay the penalty that defining a large number of transitions would impose.

 

Thanks!

 

Peter Gissel