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

Miro Samek



  • Model reactive systems with UML statecharts
  • Efficiently code statecharts directly in C/C++
  • Rapidly build embedded software with statechart-based frameworks

Model your reactive systems without heavyweight, expensive CASE tools. The author's Quantum Programming is a new paradigm that treats statecharts as a way of design rather than the use of a particular tool. It includes a complete software infrastructure for executing statecharts tailored for multithreaded embedded applications. Flexible, efficient, portable, scalable, and maintainable, this lightweight Quantum Framework permits you to quickly hand-code working real-time systems in C or C++ directly from UML statecharts.

The Quantum Framework is a complete implementation environment ? an active-object framework carefully designed to work with nearly any RTOS. It supports rapid prototyping, easy modification of states and transitions at any stage of development, and the choice of implementation language (C or C++) to match the resource constraints of the target system. Best of all, it is compact, with complete QF code typically requiring less than 5KB of code and data.

In Part I of this book, you get a clear, articulate description of the relevant concepts including traditional finite state machines, statecharts, and several statechart-based design patterns in the form of executable code examples. Learn how state nesting leads to behavioral inheritance and how it enables reuse through programming-by-difference. Part II fully describes the implementation of the Quantum Framework and explains how you can use it in your applications and port it to an RTOS of your choice.

The CD-ROM includes complete source code for the author's Quantum Framework, answers to all exercises scattered throughout the book, and an evaluation version of RTOS-32 ?a 32-bit real-time operating system for x86 processors.

Table of Contents

Section I: Statecharts

Chapter 1 Whirlwind Tour of Quantum Programming

Chapter 2 Crash Course in Statecharts

Chapter 3 Standard State Machine Implementations

Chapter 4 Implementing Behavioral Inheritance

Chapter 5 State Patterns

Chapter 6 Inheriting State Models

Section II: Quantum Framework

Chapter 7 Introducing Quantum Framework

Chapter 8 Design of QF

Chapter 9 Implementations of Quantum Framework

Chapter 10 Sample Quantum Framework Application

Chapter 11 Conclusion