Practical Statecharts in C/C++: Quantum Programming for Embedded Systems

In Part I, I showed you how to implement and use the powerful concept of the hierarchical state machine by instantiating the behavioral inheritance meta-pattern. This meta-pattern intentionally provided only the passive event processor, which must be driven externally to actually process events. In particular, the meta-pattern did not include the standard elements traditionally associated with state machines, such as an event queue, an event dispatcher, an execution context (thread), or timing services. This separation of concerns occurs for at least two reasons. First, unlike the generic event processor, the other elements necessary to execute a state machine depend heavily on the application domain and operating system support. Second, in many cases, these elements are already available. For example, GUI systems such as Microsoft Windows offer a complete event-driven environment for executing passive state machines.
However, the majority of reactive systems, most notably embedded real-time systems, do not provide such an execution infrastructure. In Part II of this book, I describe the Quantum Framework an event-driven architecture for executing state machines tailored specifically for embedded real-time systems. A real-time framework similar to the Quantum Framework is at the heart of virtually every commercial design-automation tool capable of generating real-time code. In fact, most of these real-time frameworks are based on the model of concurrent state machines that communicate...