uml_mapping.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Language" content="en-us">
  5. <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
  6. <meta name="ProgId" content="FrontPage.Editor.Document">
  7. <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
  8. <link rel="stylesheet" type="text/css" href="../../../boost.css">
  9. <title>The Boost Statechart Library - Definitions</title>
  10. </head>
  11. <body link="#0000FF" vlink="#800080">
  12. <table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
  13. "header">
  14. <tr>
  15. <td valign="top" width="300">
  16. <h3><a href="../../../index.htm"><img alt="C++ Boost" src=
  17. "../../../boost.png" border="0" width="277" height="86"></a></h3>
  18. </td>
  19. <td valign="top">
  20. <h1 align="center">The Boost Statechart Library</h1>
  21. <h2 align="center">UML to Boost.Statechart mapping summary</h2>
  22. </td>
  23. </tr>
  24. </table>
  25. <hr>
  26. <h2>Contents</h2>
  27. <dl class="page-index">
  28. <dt><a href="#StateMachine">State machine</a></dt>
  29. <dt><a href="#States">States</a></dt>
  30. <dd><a href="#NormalState">Normal state</a></dd>
  31. <dd><a href="#InitialPseudostate">Initial pseudostate</a></dd>
  32. <dd><a href="#FinalPseudostate">Final pseudostate</a></dd>
  33. <dd><a href="#ShallowHistoryPseudostate">Shallow history
  34. pseudostate</a></dd>
  35. <dd><a href="#DeepHistoryPseudostate">Deep history pseudostate</a></dd>
  36. <dd><a href="#JunctionPoint">Junction point</a></dd>
  37. <dd><a href="#DynamicChoicePoint">Dynamic choice point</a></dd>
  38. <dd><a href="#JoinAndForkBars">Join and fork bars</a></dd>
  39. <dt><a href="#Events">Events</a></dt>
  40. <dd><a href="#CallEvent">Call event</a></dd>
  41. <dd><a href="#SignalEvent">Signal event</a></dd>
  42. <dd><a href="#TimeEvent">Time event</a></dd>
  43. <dd><a href="#ChangeEvent">Change event</a></dd>
  44. <dt><a href="#Reactions">Reactions</a></dt>
  45. <dd><a href="#Guard">Guard</a></dd>
  46. <dd><a href="#Transition">Transition</a></dd>
  47. <dd><a href="#Deferral">Deferral</a></dd>
  48. <dd><a href="#InternalTransition">Internal transition (in-state
  49. reaction)</a></dd>
  50. <dt><a href="#Actions">Actions</a></dt>
  51. <dd><a href="#EntryAction">Entry action</a></dd>
  52. <dd><a href="#ExitAction">Exit action</a></dd>
  53. <dd><a href="#TransitionAction">Transition action</a></dd>
  54. <dd><a href="#DoActivity">Do activity</a></dd>
  55. </dl>
  56. <hr>
  57. <h2><a name="StateMachine" id="StateMachine">State machine</a></h2>
  58. <ul>
  59. <li>A state machine is defined by deriving a class from either the
  60. <code><a href=
  61. "reference.html#ClassTemplatestate_machine">state_machine</a></code> or
  62. the <code><a href=
  63. "reference.html#ClassTemplateasynchronous_state_machine">asynchronous_state_machine</a></code>
  64. class templates; <a href=
  65. "tutorial.html#DefiningStatesAndEvents">example</a></li>
  66. </ul>
  67. <h2><a name="States" id="States">States</a></h2>
  68. <h3><a name="NormalState" id="NormalState">Normal state</a></h3>
  69. <ul>
  70. <li>A state is defined by deriving a class from either the <code><a href=
  71. "reference.html#ClassTemplatesimple_state">simple_state</a></code> or
  72. <code><a href="reference.html#ClassTemplatestate">state</a></code> class
  73. templates; <a href=
  74. "tutorial.html#DefiningStatesAndEvents">example</a></li>
  75. <li>The position of a state in the state hierarchy is defined by what is
  76. passed as the <code>Context</code> template parameter. <a href=
  77. "definitions.html#OutermostState">Outermost states</a> pass the
  78. <code><a href=
  79. "reference.html#ClassTemplatestate_machine">state_machine&lt;&gt;</a></code>
  80. or <code><a href=
  81. "reference.html#ClassTemplateasynchronous_state_machine">asynchronous_state_machine&lt;&gt;</a></code>
  82. subtype they belong to, inner states pass their direct outer state;
  83. <a href="tutorial.html#DefiningStatesAndEvents">example</a></li>
  84. <li>A state can be made a member of a particular orthogonal region by
  85. passing an instantiation of the <code>orthogonal</code> class template
  86. nested in its outer state; <a href=
  87. "tutorial.html#OrthogonalStates">example</a></li>
  88. </ul>
  89. <h3><a name="InitialPseudostate" id="InitialPseudostate">Initial
  90. pseudostate</a></h3>
  91. <ul>
  92. <li>The state that is initially entered is identified by template
  93. parameters rather than by a default transition from the initial
  94. pseudostate (there is no such thing in Boost.Statechart)</li>
  95. <li>For <code><a href=
  96. "reference.html#ClassTemplatestate_machine">state_machine&lt;&gt;</a></code>
  97. and <code><a href=
  98. "reference.html#ClassTemplateasynchronous_state_machine">asynchronous_state_machine&lt;&gt;</a></code>
  99. the state that is initially entered needs to be specified with the
  100. <code>InitialState</code> template parameter; <a href=
  101. "tutorial.html#DefiningStatesAndEvents">example</a></li>
  102. <li>For <code><a href=
  103. "reference.html#ClassTemplatesimple_state">simple_state&lt;&gt;</a></code>
  104. and <code><a href=
  105. "reference.html#ClassTemplatestate">state&lt;&gt;</a></code> the inner
  106. state(s) that is/are initially entered can be specified with the
  107. <code>InnerInitial</code> template parameter; <a href=
  108. "tutorial.html#DefiningStatesAndEvents">example</a></li>
  109. </ul>
  110. <h3><a name="FinalPseudostate" id="FinalPseudostate">Final
  111. pseudostate</a></h3>
  112. <ul>
  113. <li>There is no such thing as a final pseudostate in
  114. Boost.Statechart</li>
  115. <li>This functionality is implemented with a special reaction
  116. (<code><a href=
  117. "reference.html#ClassTemplatetermination">termination&lt;&gt;</a></code>)
  118. and special reaction function (<code><a href=
  119. "reference.html#simple_state::terminate">simple_state&lt;&gt;::terminate()</a></code>);
  120. <a href="tutorial.html#StateQueries">example</a></li>
  121. </ul>
  122. <h3><a name="ShallowHistoryPseudostate" id=
  123. "ShallowHistoryPseudostate">Shallow history pseudostate</a></h3>
  124. <ul>
  125. <li>A shallow history transition target or shallow history inner initial
  126. state can be specified with <code><a href=
  127. "reference.html#ClassTemplateshallow_history">shallow_history&lt;&gt;</a></code></li>
  128. </ul>
  129. <h3><a name="DeepHistoryPseudostate" id="DeepHistoryPseudostate">Deep
  130. history pseudostate</a></h3>
  131. <ul>
  132. <li>A deep history transition target or deep history inner initial state
  133. can be specified with <code><a href=
  134. "reference.html#ClassTemplatedeep_history">deep_history&lt;&gt;</a></code>;
  135. <a href="tutorial.html#History">example</a></li>
  136. </ul>
  137. <h3><a name="JunctionPoint" id="JunctionPoint">Junction point</a></h3>
  138. <ul>
  139. <li>Does not exist in Boost.Statechart; <a href=
  140. "rationale.html#Limitations">rationale</a></li>
  141. </ul>
  142. <h3><a name="DynamicChoicePoint" id="DynamicChoicePoint">Dynamic choice
  143. point</a></h3>
  144. <ul>
  145. <li>Does not (yet?) exist in Boost.Statechart; <a href=
  146. "rationale.html#Limitations">rationale</a></li>
  147. </ul>
  148. <h3><a name="JoinAndForkBars" id="JoinAndForkBars">Join and fork
  149. bars</a></h3>
  150. <ul>
  151. <li>Do not exist in Boost.Statechart; <a href=
  152. "rationale.html#Limitations">rationale</a></li>
  153. </ul>
  154. <h2><a name="Events" id="Events">Events</a></h2>
  155. <ul>
  156. <li>A event is defined by deriving a class from the <a href=
  157. "reference.html#ClassTemplateevent"><code>event</code></a> class
  158. template; <a href=
  159. "tutorial.html#DefiningStatesAndEvents">example</a></li>
  160. <li>There is no distinction between signal and call events, see
  161. below</li>
  162. </ul>
  163. <h3><a name="CallEvent" id="CallEvent">Call event</a></h3>
  164. <ul>
  165. <li>All events passed to <code><a href=
  166. "reference.html#process_event">state_machine&lt;&gt;::process_event()</a></code>
  167. are implicitly call events</li>
  168. </ul>
  169. <h3><a name="SignalEvent" id="SignalEvent">Signal event</a></h3>
  170. <ul>
  171. <li>All events passed to either <code><a href=
  172. "reference.html#post_event0">simple_state&lt;&gt;::post_event()</a></code>
  173. or <code><a href=
  174. "reference.html#queue_event">fifo_scheduler&lt;&gt;::queue_event()</a></code>
  175. are implicitly signal events</li>
  176. </ul>
  177. <h3><a name="TimeEvent" id="TimeEvent">Time event</a></h3>
  178. <ul>
  179. <li>Does not exist in Boost.Statechart</li>
  180. <li>A time event can be simulated with an external timer that is started
  181. in the entry action and stopped in the exit action of a particular state.
  182. When starting the timer, it is instructed to call <code><a href=
  183. "reference.html#queue_event">fifo_scheduler&lt;&gt;::queue_event()</a></code>
  184. when the due time elapses</li>
  185. </ul>
  186. <h3><a name="ChangeEvent" id="ChangeEvent">Change event</a></h3>
  187. <ul>
  188. <li>Does not exist in Boost.Statechart</li>
  189. <li>A change event can be simulated by packing to be monitored variables
  190. into an external wrapper with <code>get</code> and <code>set</code>
  191. methods. Whenever <code>set</code> is called the wrapper posts an
  192. appropriate event</li>
  193. </ul>
  194. <h2><a name="Reactions" id="Reactions">Reactions</a></h2>
  195. <h3><a name="Guard" id="Guard">Guard</a></h3>
  196. <ul>
  197. <li>A guard can be implemented with a selection statement in a
  198. <code><a href=
  199. "reference.html#ClassTemplatecustom_reaction">custom_reaction&lt;&gt;</a></code>;
  200. <a href="tutorial.html#Guards">example</a></li>
  201. </ul>
  202. <h3><a name="Transition" id="Transition">Transition</a></h3>
  203. <ul>
  204. <li>A transition can be defined with either a <code><a href=
  205. "reference.html#ClassTemplatetransition">transition&lt;&gt;</a></code> or
  206. a call to <code><a href=
  207. "reference.html#transit1">simple_state&lt;&gt;::transit&lt;&gt;</a></code>
  208. in a <code><a href=
  209. "reference.html#ClassTemplatecustom_reaction">custom_reaction&lt;&gt;</a></code>;
  210. <a href="tutorial.html#AddingReactions">example</a></li>
  211. </ul>
  212. <h3><a name="Deferral" id="Deferral">Deferral</a></h3>
  213. <ul>
  214. <li>A deferral reaction can be defined with either a <code><a href=
  215. "reference.html#ClassTemplatedeferral">deferral&lt;&gt;</a></code> or a
  216. call to <code><a href=
  217. "reference.html#defer_event">simple_state&lt;&gt;::defer_event()</a></code>
  218. in a <code><a href=
  219. "reference.html#ClassTemplatecustom_reaction">custom_reaction&lt;&gt;</a></code>;
  220. <a href="tutorial.html#DeferringEvents">example</a></li>
  221. </ul>
  222. <h3><a name="InternalTransition" id="InternalTransition">Internal
  223. transition (in-state reaction)</a></h3>
  224. <ul>
  225. <li>An in-state reaction can be defined with either a <code><a href=
  226. "reference.html#ClassTemplatein_state_reaction">in_state_reaction&lt;&gt;</a></code>
  227. or a call to <a href=
  228. "reference.html#discard_event"><code>simple_state&lt;&gt;::discard_event()</code></a>
  229. in a <code><a href=
  230. "reference.html#ClassTemplatecustom_reaction">custom_reaction&lt;&gt;</a></code></li>
  231. </ul>
  232. <h2><a name="Actions" id="Actions">Actions</a></h2>
  233. <h3><a name="EntryAction" id="EntryAction">Entry action</a></h3>
  234. <ul>
  235. <li>A state entry action can be defined by adding a constructor to a
  236. state class; <a href="tutorial.html#HelloWorld">example</a></li>
  237. </ul>
  238. <h3><a name="ExitAction" id="ExitAction">Exit action</a></h3>
  239. <ul>
  240. <li>A state exit action can be defined by adding a destructor to a state
  241. class; <a href="tutorial.html#HelloWorld">example</a></li>
  242. </ul>
  243. <h3><a name="TransitionAction" id="TransitionAction">Transition
  244. action</a></h3>
  245. <ul>
  246. <li>A transition action can be defined by passing a function pointer
  247. referencing the action to either <code><a href=
  248. "reference.html#ClassTemplatetransition">transition&lt;&gt;</a></code> or
  249. <code><a href=
  250. "reference.html#transit2">simple_state&lt;&gt;::transit&lt;&gt;()</a></code>;
  251. <a href="tutorial.html#TransitionActions">example</a></li>
  252. </ul>
  253. <h3><a name="DoActivity" id="DoActivity">Do activity</a></h3>
  254. <ul>
  255. <li>Not supported in Boost.Statechart</li>
  256. <li>A do activity can be simulated with a separate thread that is started
  257. in the entry action and cancelled (!) in the exit action of a particular
  258. state</li>
  259. </ul>
  260. <hr>
  261. <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
  262. "../../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
  263. height="31" width="88"></a></p>
  264. <p>Revised
  265. <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38512" --></p>
  266. <p><i>Copyright &copy; 2003-<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y" startspan -->2006<!--webbot bot="Timestamp" endspan i-checksum="770" -->
  267. <a href="contact.html">Andreas Huber D&ouml;nni</a></i></p>
  268. <p><i>Distributed under the Boost Software License, Version 1.0. (See
  269. accompanying file <a href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  270. copy at <a href=
  271. "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
  272. </body>
  273. </html>