boost-react-native-bundle
Version:
Boost library as in https://sourceforge.net/projects/boost/files/boost/1.57.0/
271 lines • 136 kB
HTML
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Front-end</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="pt02.html" title="Part II. Reference"><link rel="prev" href="re02.html" title="Back-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">Front-end</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re02.html">Prev</a> </td><th width="60%" align="center">Part II. Reference</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="refentry" title="Front-end"><a name="d0e5639"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>Front-end — The front-end headers</p></div><div class="refsect1" title="msm/front/common_states.hpp"><a name="d0e5645"></a><h2>msm/front/common_states.hpp</h2><p>This header contains the predefined types to serve as base for states or state machines:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>default_base_state: non-polymorphic empty type.</p></li><li class="listitem"><p>polymorphic_state: type with a virtual destructor, which makes all
states polymorphic.</p></li></ul></div></div><div class="refsect1" title="msm/front/completion_event.hpp"><a name="d0e5657"></a><h2>msm/front/completion_event.hpp</h2><p>This header contains one type, <code class="code">none</code>. This type has several
meanings inside a transition table:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>as action or guard: that there is no action or guard</p></li><li class="listitem"><p>as target state: that the transition is an internal
transition</p></li><li class="listitem"><p>as event: the transition is an anonymous (completion)
transition</p></li></ul></div></div><div class="refsect1" title="msm/front/functor_row.hpp"><a name="d0e5675"></a><h2>msm/front/functor_row.hpp</h2><p>This header implements the functor front-end's transitions and helpers.</p><div class="refsect2" title="Row"><a name="d0e5680"></a><h3>Row</h3><div class="refsect3" title="definition"><a name="d0e5683"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template <class Source,class Event,class Target,class
Action,class Guard> Row</span></span> {<br>}</pre></div><div class="refsect3" title="tags"><a name="d0e5690"></a><h4>tags</h4><p>row_type_tag is defined differently for every specialization:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>all 5 template parameters means a normal transition with
action and guard: <code class="code">typedef row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,Target,none,none> a normal transition
without action or guard: <code class="code">typedef _row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,Target,Action,none> a normal
transition without guard: <code class="code">typedef a_row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,Target,none,Guard> a normal transition
without action: <code class="code">typedef g_row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,none,Action,none> an internal
transition without guard: <code class="code">typedef a_irow_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,none,none,Guard> an internal
transition without action: <code class="code">typedef g_irow_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,none,none,Guard> an internal
transition with action and guard: <code class="code">typedef irow_tag
row_type_tag;</code></p></li><li class="listitem"><p>Row<Source,Event,none,none,none> an internal transition
without action or guard: <code class="code">typedef _irow_tag
row_type_tag;</code></p></li></ul></div></div><div class="refsect3" title="methods"><a name="d0e5736"></a><h4>methods</h4><p>Like any other front-end, Row implements the two necessary static
functions for action and guard call. Each function receives as parameter
the (deepest-level) state machine processsing the event, the event
itself, the source and target states and all the states contained in a
state machine.</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static void action_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static bool guard_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div></div></div><div class="refsect2" title="Internal"><a name="d0e5759"></a><h3>Internal</h3><div class="refsect3" title="definition"><a name="d0e5762"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template <class Event,class Action,class Guard>
Internal</span></span> {<br>}</pre></div><div class="refsect3" title="tags"><a name="d0e5769"></a><h4>tags</h4><p>row_type_tag is defined differently for every specialization:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>all 3 template parameters means an internal transition
with action and guard: <code class="code">typedef sm_i_row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Internal<Event,none,none> an internal transition
without action or guard: <code class="code">typedef sm__i_row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Internal<Event,Action,none> an internal transition
without guard: <code class="code">typedef sm_a_i_row_tag
row_type_tag;</code></p></li><li class="listitem"><p>Internal<Event,none,Guard> an internal transition
without action: <code class="code">typedef sm_g_i_row_tag
row_type_tag;</code></p></li></ul></div></div><div class="refsect3" title="methods"><a name="d0e5795"></a><h4>methods</h4><p>Like any other front-end, Internal implements the two necessary static
functions for action and guard call. Each function receives as parameter
the (deepest-level) state machine processsing the event, the event
itself, the source and target states and all the states contained in a
state machine.</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static void action_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static bool guard_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div></div></div><div class="refsect2" title="ActionSequence_"><a name="d0e5818"></a><h3>ActionSequence_</h3><p>This functor calls every element of the template Sequence (which are also
callable functors) in turn. It is also the underlying implementation of the
eUML sequence grammar (action1,action2,...).</p><div class="refsect3" title="definition"><a name="d0e5823"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template <class Sequence> ActionSequence_</span></span> {<br>}</pre></div><div class="refsect3" title="methods"><a name="d0e5830"></a><h4>methods</h4><p>This helper functor is made for use in a transition table and in a
state behavior and therefore implements an operator() with 3 and with 4
arguments:</p><p>
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Evt,class Fsm,class
SourceState,class TargetState> operator()(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>Evt const& ,Fsm& ,SourceState&
,TargetState& </code>;</div><div class="funcprototype-spacer"> </div></div><p>
</p><p>
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Evt,class Fsm,class State>
operator()(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>Evt const&, Fsm&, State&</code>;</div><div class="funcprototype-spacer"> </div></div><p>
</p></div></div><div class="refsect2" title="Defer"><a name="d0e5853"></a><h3>Defer</h3><div class="refsect3" title="definition"><a name="d0e5856"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">Defer</span></span> {<br>}</pre></div><div class="refsect3" title="methods"><a name="d0e5863"></a><h4>methods</h4><p>This helper functor is made for use in a transition table and
therefore implements an operator() with 4 arguments:</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Evt,class Fsm,class SourceState,class
TargetState> operator()(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>Evt const&, Fsm& , SourceState&,
TargetState&</code>;</div><div class="funcprototype-spacer"> </div></div></div></div></div><div class="refsect1" title="msm/front/internal_row.hpp"><a name="d0e5874"></a><h2>msm/front/internal_row.hpp</h2><p>This header implements the internal transition rows for use inside an
internal_transition_table. All these row types have no source or target state,
as the backend will recognize internal transitions from this
internal_transition_table.</p><div class="refsect2" title="methods"><a name="d0e5879"></a><h3>methods</h3><p>Like any other front-end, the following transition row types implements
the two necessary static functions for action and guard call. Each function
receives as parameter the (deepest-level) state machine processsing the
event, the event itself, the source and target states and all the states
contained in a state machine.</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static void action_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static bool guard_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div></div><div class="refsect2" title="a_internal"><a name="d0e5902"></a><h3>a_internal</h3><div class="refsect3" title="definition"><a name="d0e5905"></a><h4>definition</h4><p>This is an internal transition with an action called during the
transition.</p><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Event, class CalledForAction, void
(CalledForAction::*action)(Event const&)>
a_internal</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e5914"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the internal
transition.</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="g_internal"><a name="d0e5930"></a><h3>g_internal</h3><p>This is an internal transition with a guard called before the transition
and allowing the transition if returning true.</p><div class="refsect3" title="definition"><a name="d0e5935"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Event, class CalledForGuard, bool
(CalledForGuard::*guard)(Event const&)>
g_internal</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e5942"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the internal
transition.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="internal"><a name="d0e5958"></a><h3>internal</h3><p>This is an internal transition with a guard called before the transition
and allowing the transition if returning true. It also calls an action
called during the transition.</p><div class="refsect3" title="definition"><a name="d0e5963"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Event, class CalledForAction, void
(CalledForAction::*action)(Event const&), class
CalledForGuard, bool (CalledForGuard::*guard)(Event const&)>
internal</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e5970"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the internal transition</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="_internal"><a name="d0e5992"></a><h3>_internal</h3><p>This is an internal transition without action or guard. This is equivalent
to an explicit "ignore event".</p><div class="refsect3" title="definition"><a name="d0e5997"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Event > _internal</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6004"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the internal
transition.</p></li></ul></div><p>
</p></div></div></div><div class="refsect1" title="msm/front/row2.hpp"><a name="d0e6014"></a><h2>msm/front/row2.hpp</h2><p>This header contains the variants of row2, which are an extension of the
standard row transitions for use in the transition table. They offer the
possibility to define action and guard not only in the state machine, but in any
state of the state machine. They can also be used in internal transition tables
through their irow2 variants.</p><div class="refsect2" title="methods"><a name="d0e6019"></a><h3>methods</h3><p>Like any other front-end, the following transition row types implements
the two necessary static functions for action and guard call. Each function
receives as parameter the (deepest-level) state machine processsing the
event, the event itself, the source and target states and all the states
contained in a state machine.</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static void action_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static bool guard_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div></div><div class="refsect2" title="_row2"><a name="d0e6042"></a><h3>_row2</h3><p>This is a transition without action or guard. The state machine only
changes active state.</p><div class="refsect3" title="definition"><a name="d0e6047"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, class Target >
_row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6054"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="a_row2"><a name="d0e6070"></a><h3>a_row2</h3><p>This is a transition with action and without guard.</p><div class="refsect3" title="definition"><a name="d0e6075"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, class Target,
</span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForAction, void
(CalledForAction::*action)(Event const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6086"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="g_row2"><a name="d0e6108"></a><h3>g_row2</h3><p>This is a transition with guard and without action.</p><div class="refsect3" title="definition"><a name="d0e6113"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, class Target,
</span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForGuard, bool (CalledForGuard::*guard)(Event
const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6124"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="row2"><a name="d0e6146"></a><h3>row2</h3><p>This is a transition with guard and action.</p><div class="refsect3" title="definition"><a name="d0e6151"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, class Target,
</span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForAction, void
(CalledForAction::*action)(Event const&), </span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForGuard, bool (CalledForGuard::*guard)(Event
const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6166"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="a_irow2"><a name="d0e6194"></a><h3>a_irow2</h3><p>This is an internal transition for use inside a transition table, with
action and without guard.</p><div class="refsect3" title="definition"><a name="d0e6199"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, </span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForAction, void
(CalledForAction::*action)(Event const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6210"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="g_irow2"><a name="d0e6229"></a><h3>g_irow2</h3><p>This is an internal transition for use inside a transition table, with
guard and without action.</p><div class="refsect3" title="definition"><a name="d0e6234"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, </span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForGuard, bool (CalledForGuard::*guard)(Event
const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6245"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div><div class="refsect2" title="irow2"><a name="d0e6264"></a><h3>irow2</h3><p>This is an internal transition for use inside a transition table, with
guard and action.</p><div class="refsect3" title="definition"><a name="d0e6269"></a><h4>definition</h4><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template< class Source, class Event, </span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForAction, void
(CalledForAction::*action)(Event const&), </span></span> {<br>}</pre><pre class="classsynopsis"> <span class="ooclass"><span class="classname">class CalledForGuard, bool (CalledForGuard::*guard)(Event
const&) > _row2</span></span> {<br>}</pre></div><div class="refsect3" title="template parameters"><a name="d0e6284"></a><h4>template parameters</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>action: a pointer to the method which CalledForAction
provides.</p></li><li class="listitem"><p>CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.</p></li><li class="listitem"><p>guard: a pointer to the method which CalledForGuard
provides.</p></li></ul></div><p>
</p></div></div></div><div class="refsect1" title="msm/front/state_machine_def.hpp"><a name="d0e6309"></a><h2>msm/front/state_machine_def.hpp</h2><p>This header provides the implementation of the <span class="command"><strong><a class="command" href="ch03s02.html#basic-front-end">basic front-end</a></strong></span>. It contains one
type, <code class="code">state_machine_def</code></p><div class="refsect2" title="state_machine_def definition"><a name="d0e6319"></a><h3>state_machine_def definition</h3><p>This type is the basic class for a basic (or possibly any other)
front-end. It provides the standard row types (which includes internal
transitions) and a default implementation of the required methods and
typedefs.</p><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template <class Derived,class BaseState =
default_base_state> state_machine_def</span></span> {<br>}</pre><div class="refsect3" title="typedefs"><a name="d0e6328"></a><h4>typedefs</h4><p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>flag_list: by default, no flag is set in the state
machine</p></li><li class="listitem"><p>deferred_events: by default, no event is deferred.</p></li><li class="listitem"><p>configuration: by default, no configuration customization
is done.</p></li></ul></div><p>
</p></div><div class="refsect3" title="row methods"><a name="d0e6344"></a><h4>row methods</h4><p>Like any other front-end, the following transition row types
implements the two necessary static functions for action and guard call.
Each function receives as parameter the (deepest-level) state machine
processsing the event, the event itself, the source and target states
and all the states contained in a state machine (ignored).</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static void action_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class SourceState,class TargetState,
class AllStates> static bool guard_call(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div></div><div class="refsect3" title="a_row"><a name="d0e6367"></a><h4>a_row</h4><p>This is a transition with action and without guard.</p><p><code class="classname">template< class Source, class Event, class Target,
void (Derived::*action)(Event const&) > a_row</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>action: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="g_row"><a name="d0e6392"></a><h4>g_row</h4><p>This is a transition with guard and without action.</p><p><code class="classname">template< class Source, class Event, class Target,
bool (Derived::*guard)(Event const&) > g_row</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>guard: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="row"><a name="d0e6417"></a><h4>row</h4><p>This is a transition with guard and action.</p><p><code class="classname">template< class Source, class Event, class Target,
void (Derived::*action)(Event const&), bool
(Derived::*guard)(Event const&) > row</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li><li class="listitem"><p>action: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li><li class="listitem"><p>guard: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="_row"><a name="d0e6448"></a><h4>_row</h4><p>This is a transition without action or guard. The state machine only
changes active state.</p><p><code class="classname">template< class Source, class Event, class Target >
_row</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>Target: the target state of the transition.</p></li></ul></div></div><div class="refsect3" title="a_irow"><a name="d0e6467"></a><h4>a_irow</h4><p>This is an internal transition for use inside a transition table, with
action and without guard.</p><p><code class="classname">template< class Source, class Event, void
(Derived::*action)(Event const&) > a_irow</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>action: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="g_irow"><a name="d0e6489"></a><h4>g_irow</h4><p>This is an internal transition for use inside a transition table, with
guard and without action.</p><p><code class="classname">template< class Source, class Event, bool
(Derived::*guard)(Event const&) > g_irow</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>guard: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="irow"><a name="d0e6511"></a><h4>irow</h4><p>This is an internal transition for use inside a transition table, with
guard and action.</p><p><code class="classname">template< class Source, class Event, void
(Derived::*action)(Event const&), bool
(Derived::*guard)(Event const&) > irow</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li><li class="listitem"><p>action: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li><li class="listitem"><p>guard: a pointer to the method provided by the concrete
front-end (represented by <code class="code">Derived</code>).</p></li></ul></div></div><div class="refsect3" title="_irow"><a name="d0e6539"></a><h4>_irow</h4><p>This is an internal transition without action or guard. As it does
nothing, it means "ignore event".</p><p><code class="classname">template< class Source, class Event >
_irow</code></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Event: the event triggering the transition.</p></li><li class="listitem"><p>Source: the source state of the transition.</p></li></ul></div></div><div class="refsect3" title="methods"><a name="d0e6555"></a><h4>methods</h4><p><code class="code">state_machine_def</code> provides a default implementation in
case of an event which cannot be processed by a state machine (no
transition found). The implementation is using a
<code class="code">BOOST_ASSERT</code> so that the error will only be noticed in
debug mode. Overwrite this method in your implementation to change the
behavior.</p><p>
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class Event> static void
no_transition(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Event const& ,Fsm&, int
state<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><p>
</p><p><code class="code">state_machine_def</code> provides a default implementation in
case an exception is thrown by a state (entry/exit) or transition
(action/guard) behavior. The implementation is using a
<code class="code">BOOST_ASSERT</code> so that the error will only be noticed in
debug mode. Overwrite this method in your implementation to change the
behavior. This method will be called only if exception handling is not
deactivated (default) by defining
<code class="code">has_no_message_queue</code>.</p><p>
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">template <class Fsm,class Event> static void
exception_caught(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>
<code>(</code>Event const& ,Fsm&,
std::exception&<code>)</code>
</code>;</div><div class="funcprototype-spacer"> </div></div><p>
</p></div></div></div><div class="refsect1" title="msm/front/states.hpp"><a name="d0e6599"></a><h2>msm/front/states.hpp </h2><p>This header provides the different states (except state machines) for the
basic front-end (or mixed with other front-ends).</p><div class="refsect2" title="types"><a name="d0e6604"></a><h3>types</h3><p>This header provides the following types:</p><div class="refsect3" title="no_sm_ptr"><a name="d0e6609"></a><h4>no_sm_ptr</h4><p>deprecated: default policy for states. It means that states do not
need to save a pointer to their containing state machine.</p></div><div class="refsect3" title="sm_ptr"><a name="d0e6614"></a><h4>sm_ptr</h4><p>deprecated: state policy. It means that states need to save a pointer
to their containing state machine. When seeing this flag, the back-end
will call set_sm_ptr(fsm*) and give itself as argument.</p></div><div class="refsect3" title="state"><a name="d0e6619"></a><h4>state</h4><p>Basic type for simple states. Inherit from this type to define a
simple state. The first argument is needed if you want your state (and
all others used in a concrete state machine) to inherit a basic type for
logging or providing a common behavior.</p><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template<class Base = default_base_state,class
SMPtrPolicy = no_sm_ptr> state</span></span> {<br>}</pre></div><div class="refsect3" title="terminate_state"><a name="d0e6628"></a><h4>terminate_state</h4><p>Basic type for terminate states. Inherit from this type to define a
terminate state. The first argument is needed if you want your state
(and all others used in a concrete state machine) to inherit a basic
type for logging or providing a common behavior.</p><pre class="classsynopsis"> <span class="ooclass"><span class="classname">template<class Base = default_base_state,class
SMPtrPolicy = no_sm_ptr> terminate_state</span></span> {<br>}</pre></div><div class