ABSTRACT

In the previous chapter, you learned how to implement hierarchical state machines (HSMs) in C++ and in C by instantiating the behavioral inheritance meta-pattern. In fact, applying the pattern turned out to be a rather simple one-to-one mapping between a state model and the code. With just a bit of practice, you will forget that you are translating state models into code; rather, you will directly code state machines in C or C++, just as you directly code classes in C++ or Java.