mirror of
https://github.com/boostorg/msm.git
synced 2026-02-02 09:02:09 +00:00
21 lines
9.1 KiB
HTML
21 lines
9.1 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>Chapter 3. Tutorial</title><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#d0e1118">Event Hierarchy</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1139">Customizing a state machine / Getting more speed</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1188">Choosing the initial event</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1201"> 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#d0e1240"> Transition table </a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1273">Defining states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1292">What do you actually do inside actions / guards (Part 2)?</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1304">Defining a simple state machine</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1312">Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1338">Internal
|
|
transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1384">Kleene (any) event</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s04.html">eUML (experimental)</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s04.html#d0e1454">Transition table</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1495">A simple example: rewriting only our transition table </a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1528">Defining events, actions and states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1641">Wrapping up a simple state machine and first complete examples</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1689">Defining a submachine</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1705">
|
|
Attributes / Function call</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1805">Orthogonal regions, flags, event deferring</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1917">
|
|
Customizing a state machine / Getting
|
|
more speed</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1952">Completion / Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1970">Internal transitions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2001">Kleene(any) event)</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2016">Other state types</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2080">Helper functions</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2183">Phoenix-like STL support</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e2236">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#d0e2295">Creation </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2304">Starting and stopping a state
|
|
machine</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2323">Event dispatching</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2332">Active state(s)</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2346">Serialization</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2399">Base state type </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2425">Visitor</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2468">Flags</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2481">Getting a state</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2494"> State machine constructor with arguments </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2534">Trading run-time speed for
|
|
better compile-time / multi-TU compilation</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2616">Compile-time state machine analysis </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2660"> Enqueueing events for later
|
|
processing </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2680"> Customizing the message queues </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2695">Policy definition with Boost.Parameter </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2703">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> |