configuration.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 http-equiv="Content-Type" content="text/html; charset=us-ascii">
  6. <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
  7. <meta name="ProgId" content="FrontPage.Editor.Document">
  8. <link rel="stylesheet" type="text/css" href="../../../boost.css">
  9. <title>The Boost Statechart Library - Configuration</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">Configuration</h2>
  22. </td>
  23. </tr>
  24. </table>
  25. <hr>
  26. <dl class="page-index">
  27. <dt><a href="#GeneralConfiguration">General configuration</a></dt>
  28. <dd><a href="#Introduction">Introduction</a></dd>
  29. <dd><a href="#DebugModeCompilationOptions">Debug mode compilation
  30. options</a></dd>
  31. <dd><a href="#ReleaseModeCompilationOptions">Release mode compilation
  32. options</a></dd>
  33. <dd><a href="#ApplicationDefinedMacros">Application Defined
  34. Macros</a></dd>
  35. </dl>
  36. <h1><a id="GeneralConfiguration" name="GeneralConfiguration">General
  37. configuration</a></h1>
  38. <h2><a id="Introduction" name="Introduction">Introduction</a></h2>
  39. <p>The library uses several configuration macros in <a href=
  40. "../../../libs/config/config.htm">&lt;boost/config.hpp&gt;</a>, as well as
  41. two configuration macros meant to be supplied by the application. Moreover,
  42. two commonly available compiler options also have an impact on the
  43. available features.</p>
  44. <h2><a id="DebugModeCompilationOptions" name=
  45. "DebugModeCompilationOptions">Debug mode compilation options</a></h2>
  46. <ul>
  47. <li>C++ RTTI must be turned on (used by various asserts)</li>
  48. <li>C++ exception handling can be turned on or off. When turned off,
  49. obviously the library's <a href="tutorial.html#ExceptionHandling">error
  50. handling support</a> is no longer available</li>
  51. </ul>
  52. <h2><a id="ReleaseModeCompilationOptions" name=
  53. "ReleaseModeCompilationOptions">Release mode compilation options</a></h2>
  54. <ul>
  55. <li>C++ RTTI can be turned on or off. When turned off, the use of
  56. <code><a href="reference.html#state_cast">state_cast&lt;&gt;()</a></code>
  57. leads to a compile time error (<code><a href=
  58. "reference.html#state_downcast">state_downcast&lt;&gt;()</a></code> is
  59. still available). Moreover, <code>BOOST_STATECHART_USE_NATIVE_RTTI</code>
  60. must not be defined simultaneously</li>
  61. <li>C++ exception handling can be turned on or off. When turned off,
  62. obviously the library's <a href="tutorial.html#ExceptionHandling">error
  63. handling support</a> is no longer available</li>
  64. </ul>
  65. <h2><a id="ApplicationDefinedMacros" name=
  66. "ApplicationDefinedMacros">Application Defined Macros</a></h2>
  67. <p>The following macros may be defined by an application using the
  68. library:</p>
  69. <table summary="application defined macros" width="100%" cellpadding="2"
  70. border="3">
  71. <tr>
  72. <td width="226"><b>Macro</b></td>
  73. <td width="893"><b>Meaning</b></td>
  74. </tr>
  75. <tr>
  76. <td width="226"><code>BOOST_STATECHART_USE_NATIVE_RTTI</code></td>
  77. <td width="893">
  78. When defined, the library no longer uses its own speed-optimized RTTI
  79. implementation. Instead, native C++ RTTI is employed (see <a href=
  80. "performance.html#RttiCustomization">RTTI customization</a> in the
  81. performance document for more information). This has the following
  82. effects:
  83. <ul>
  84. <li><code>state_machine::state_base_type</code> becomes a
  85. polymorphic type. That is, when <code>typeid</code> is applied to a
  86. <code>state_machine::state_base_type</code> reference, the result
  87. refers to a <code>type_info</code> object representing the the type
  88. of the most derived state type</li>
  89. <li><a href="tutorial.html#CustomStateTypeInformation">Custom state
  90. type information</a> is no longer available</li>
  91. <li>All states need to store one pointer less, leading to a
  92. best-case state machine memory footprint reduction of about
  93. 15%</li>
  94. <li>Under most circumstances, dispatch speed degrades. This is
  95. because native C++ RTTI values are retrieved through an additional
  96. indirection on almost all platforms. See <a href=
  97. "performance.html#SpeedVersusScalabilityTradeoffs">Speed versus
  98. scalability tradeoffs</a> in the performance document for
  99. timings</li>
  100. </ul>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td width="226">
  105. <code>BOOST_STATECHART_RELAX_TRANSITION_CONTEXT</code></td>
  106. <td width="893">When defined, the sequence of actions that are called
  107. during a transition is relaxed. That is, its is no longer necessary
  108. that all states up to the innermost common context are exited before
  109. the transition action is called (as mandated by the UML standard).
  110. Instead, the transition action can be a member of either the transition
  111. source or any direct or indirect outer context and is called as soon as
  112. all possibly active inner states have been exited. Then all remaining
  113. active states up to the innermost common context are exited before
  114. entering all states down to the transition destination</td>
  115. </tr>
  116. </table>
  117. <p>Both macros need to be consistently defined or undefined for all
  118. translation units that are later linked into the same executable. Not doing
  119. so will inevitably lead to ODR violations. Depending on compiler and linker
  120. technology such violations may or may not manifest themselves in link-time
  121. errors.</p>
  122. <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
  123. "../../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
  124. height="31" width="88"></a></p>
  125. <p>Revised 05 January, 2008</p>
  126. <p><i>Copyright &copy; 2003-2008 <a href="contact.html">Andreas Huber
  127. D&ouml;nni</a></i></p>
  128. <p><i>Distributed under the Boost Software License, Version 1.0. (See
  129. accompanying file <a href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  130. copy at <a href=
  131. "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
  132. </body>
  133. </html>