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