2
0
mirror of https://github.com/boostorg/msm.git synced 2026-02-18 14:12:31 +00:00
Files
msm/doc/HTML/ar01s06.html
Christophe Henry 9f03aaa362 msm added to trunk
[SVN r62129]
2010-05-21 21:15:38 +00:00

29 lines
5.0 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Questions &amp; Answers</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="index.html" title="Meta State Machine (MSM)"><link rel="prev" href="ar01s05.html" title="Performance / Compilers"><link rel="next" href="ar01s07.html" title="Internals"></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">Questions &amp; Answers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s05.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ar01s07.html">Next</a></td></tr></table><hr></div><div class="sect1" title="Questions &amp; Answers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3798"></a>Questions &amp; Answers</h2></div></div></div><p><span class="underline">Question</span>: on_entry gets as argument, the sent
event. What event do I get when the state becomes default-activated (because it is an
initial state)?</p><p>
<span class="underline">Answer</span>: To allow you to know that the state was
default-activated, MSM generates a boost::msm::InitEvent default event. </p><p><span class="underline">Question</span>: Why do I see no call to no_transition
in my composite state? </p><p><span class="underline">Answer</span>: Because of the priority rule defined by
UML. It says that in case of transition conflict, the most inner state has a higher
priority. So after asking the inner state, the containing composite has to be also asked
to handle the transition and could find a possible transition.</p><p><span class="underline">Question</span>: Why do I get a compile error saying
the compiler cannot convert to a function ...Fsm::*(some_event)? </p><p><span class="underline">Answer</span>: You probably defined a transition
triggered by the event some_event, but used a guard/action method taking another event. </p><p><span class="underline">Question</span>: Why do I get a compile error saying
something like &#8220;too few&#8221; or &#8220;too many&#8221; template arguments? </p><p><span class="underline">Answer</span>: You probably defined a transition in
form of a a_row or g_row where you wanted just a _row or the other way around. With Row,
it could mean that you forgot a "none". </p><p><span class="underline">Question</span>: Why do I get a very long compile error
when I define more than 20 rows in the transition table? </p><p><span class="underline">Answer</span>: MSM uses Boost.MPL under the hood and
this is the default maximum size. Please define the following 3 macros before including
any MSM headers: </p><p><code class="code">#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS </code></p><p><code class="code">#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need </code></p><p><code class="code">#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need </code></p><p><span class="underline">Question</span>: Why do I get this error: &#8221;error C2977:
'boost::mpl::vector' : too many template arguments&#8221;? </p><p><span class="underline">Answer</span>: The first possibility is that you
defined a transition table as, say, vector17 and have 18 entries. The second is that you
have 17 entries and have a composite state. Under the hood, MSM adds a row for every
event in the composite transition table. The third one is that you used a mpl::vector
without the number of entries but are close to the MPL default of 50 and have a
composite, thus pushing you above 50. Then you need mpl/vector60/70&#8230;.hpp and a
mpl/map60/70&#8230;.hpp </p><p><span class="underline">Question</span>: Why do I get a very long compile error
when I define more than 10 states in a state machine? </p><p><span class="underline">Answer</span>: Msm uses Boost.Fusion under the hood and
this is the default maximum size. Please define the following macro before including any
MSM headers: </p><p><code class="code">#define FUSION_MAX_VECTOR_SIZE 20 // or whatever you need </code></p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ar01s05.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ar01s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> Performance / Compilers&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Internals</td></tr></table></div></body></html>