21 lines
9.2 KiB
HTML
21 lines
9.2 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>Chapter 3. Tutorial</title><link rel="stylesheet" href="boostbook.css" type="text/css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"><link rel="home" href="index.html" title="Meta State Machine (MSM)"><link rel="up" href="pt01.html" title="Part I. User' guide"><link rel="prev" href="ch02s04.html" title="State machine glossary"><link rel="next" href="ch03s02.html" title="Basic front-end"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><th width="60%" align="center">Part I. User' guide</th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 3. Tutorial"><div class="titlepage"><div><div><h2 class="title"><a name="d0e322"></a>Chapter 3. Tutorial</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch03.html#d0e325">Design</a></span></dt><dt><span class="sect1"><a href="ch03s02.html">Basic front-end</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s02.html#d0e344">A simple example</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e358">Transition table</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e406">Defining states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e419">What do you actually do inside actions / guards?</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e471">Defining a simple state machine</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e529">Defining a submachine</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e577">Orthogonal regions, terminate state, event deferring</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e668">History</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e713">Completion (anonymous) transitions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e740">Internal transitions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e842">more row types</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e875">Explicit entry / entry and exit pseudo-state / fork</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1064">Flags</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1126">Event Hierarchy</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1147">Customizing a state machine / Getting more speed</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1196">Choosing the initial event</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1209"> Containing state machine (deprecated)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s03.html">Functor front-end</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s03.html#d0e1248"> Transition table </a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1281">Defining states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1300">What do you actually do inside actions / guards (Part 2)?</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1312">Defining a simple state machine</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1320">Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1346">Internal
|
|
transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1392">Kleene (any) event</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s04.html">eUML</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s04.html#d0e1462">Transition table</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1503">A simple example: rewriting only our transition table </a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1536">Defining events, actions and states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1649">Wrapping up a simple state machine and first complete examples</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1697">Defining a submachine</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1713">
|
|
Attributes / Function call</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1813">Orthogonal regions, flags, event deferring</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1925">
|
|
Customizing a state machine / Getting
|
|
more speed</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1960">Completion / Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1978">Internal transitions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2009">Kleene(any) event)</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2024">Other state types</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2088">Helper functions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2191">Phoenix-like STL support</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2244">Writing actions with Boost.Phoenix (in development)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s05.html">Back-end</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s05.html#d0e2303">Creation </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2312">Starting and stopping a state
|
|
machine</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2331">Event dispatching</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2340">Active state(s)</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2354">Serialization</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2407">Base state type </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2433">Visitor</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2476">Flags</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2489">Getting a state</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2502"> State machine constructor with arguments </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2542">Trading run-time speed for
|
|
better compile-time / multi-TU compilation</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2624">Compile-time state machine analysis </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2668"> Enqueueing events for later
|
|
processing </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2691"> Customizing the message queues </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2706">Policy definition with Boost.Parameter </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2714">Choosing when to switch active
|
|
states </a></span></dt></dl></dd></dl></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e325"></a>Design</h2></div></div></div><p>MSM is divided between front–ends and back-ends. At the moment, there is just
|
|
one back-end. On the front-end side, you will find three of them which are as
|
|
many state machine description languages, with many more possible. For potential
|
|
language writers, this document contains a <a class="link" href="ch06s02.html#internals-front-back-interface">description of the interface
|
|
between front-end and back-end</a>.</p><p>The first front-end is an adaptation of the example provided in the <a class="link" href="http://boostpro.com/mplbook" target="_top">MPL book</a> with actions
|
|
defined as pointers to state or state machine methods. The second one is based
|
|
on functors. The third, eUML (embedded UML) is an experimental language based on
|
|
Boost.Proto and Boost.Typeof and hiding most of the metaprogramming to increase
|
|
readability. Both eUML and the functor front-end also offer a functional library
|
|
(a bit like Boost.Phoenix) for use as action language (UML defining
|
|
none).</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">State machine glossary </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Basic front-end</td></tr></table></div></body></html> |