mirror of
https://github.com/boostorg/msm.git
synced 2026-01-23 17:52:11 +00:00
21 lines
9.6 KiB
HTML
21 lines
9.6 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#d0e400">Defining states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e413">What do you actually do inside actions / guards?</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e465">Defining a simple state machine</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e518">Defining a submachine</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e566">Orthogonal regions, terminate state, event deferring</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e657">History</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e702">Completion (anonymous) transitions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e729">Internal transitions</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e831">more row types</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e864">Explicit entry / entry and exit pseudo-state / fork</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1053">Flags</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1115">Event Hierarchy</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1136">Customizing a state machine / Getting more speed</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1185">Choosing the initial event</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#d0e1198"> 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#d0e1237"> Transition table </a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1270">Defining states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1289">What do you actually do inside actions / guards (Part 2)?</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1301">Defining a simple state machine</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1309">Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1335">Internal
|
|
transitions</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#d0e1381">Kleene (any) event</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s04.html">PUML (C++-20), experimental</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s04.html#d0e1422">PlantUML basics</a></span></dt><dt><span class="sect2"><a href="ch03s04.html#d0e1502">Composite State Machines</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s05.html">eUML</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s05.html#d0e1555">Transition table</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1596">A simple example: rewriting only our transition table </a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1629">Defining events, actions and states with entry/exit actions</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1742">Wrapping up a simple state machine and first complete examples</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1790">Defining a submachine</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1806">
|
|
Attributes / Function call</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e1906">Orthogonal regions, flags, event deferring</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2018">
|
|
Customizing a state machine / Getting
|
|
more speed</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2053">Completion / Anonymous transitions</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2071">Internal transitions</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2102">Kleene(any) event)</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2117">Other state types</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2181">Helper functions</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2284">Phoenix-like STL support</a></span></dt><dt><span class="sect2"><a href="ch03s05.html#d0e2337">Writing actions with Boost.Phoenix (in development)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s06.html">Back-end</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s06.html#d0e2396">Creation </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2405">Starting and stopping a state
|
|
machine</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2424">Event dispatching</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2433">Active state(s)</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2447">Upper State Machine (msm::back11 only)</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2452">Serialization</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2505">Base state type </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2531">Visitor</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2574">Flags</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2587">Getting a state</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2600"> State machine constructor with arguments </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2640">Trading run-time speed for
|
|
better compile-time / multi-TU compilation (msm::back only)</a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2726">Compile-time state machine analysis </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2770"> Enqueueing events for later
|
|
processing </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2793"> Customizing the message queues </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2808">Policy definition with Boost.Parameter </a></span></dt><dt><span class="sect2"><a href="ch03s06.html#d0e2816">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> |