1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
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">
11 <title>The Boost Statechart Library - Configuration
</title>
14 <body link=
"#0000FF" vlink=
"#800080">
15 <table border=
"0" cellpadding=
"7" cellspacing=
"0" width=
"100%" summary=
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>
24 <h1 align=
"center">The Boost Statechart Library
</h1>
26 <h2 align=
"center">Configuration
</h2>
32 <dl class=
"page-index">
33 <dt><a href=
"#GeneralConfiguration">General configuration
</a></dt>
35 <dd><a href=
"#Introduction">Introduction
</a></dd>
37 <dd><a href=
"#DebugModeCompilationOptions">Debug mode compilation
40 <dd><a href=
"#ReleaseModeCompilationOptions">Release mode compilation
43 <dd><a href=
"#ApplicationDefinedMacros">Application Defined
47 <h1><a id=
"GeneralConfiguration" name=
"GeneralConfiguration">General
48 configuration
</a></h1>
50 <h2><a id=
"Introduction" name=
"Introduction">Introduction
</a></h2>
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>
58 <h2><a id=
"DebugModeCompilationOptions" name=
59 "DebugModeCompilationOptions">Debug mode compilation options
</a></h2>
62 <li>C++ RTTI must be turned on (used by various asserts)
</li>
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>
69 <h2><a id=
"ReleaseModeCompilationOptions" name=
70 "ReleaseModeCompilationOptions">Release mode compilation options
</a></h2>
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>
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>
85 <h2><a id=
"ApplicationDefinedMacros" name=
86 "ApplicationDefinedMacros">Application Defined Macros
</a></h2>
88 <p>The following macros may be defined by an application using the
91 <table summary=
"application defined macros" width=
"100%" cellpadding=
"2"
94 <td width=
"226"><b>Macro
</b></td>
96 <td width=
"893"><b>Meaning
</b></td>
100 <td width=
"226"><code>BOOST_STATECHART_USE_NATIVE_RTTI
</code></td>
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
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>
116 <li><a href=
"tutorial.html#CustomStateTypeInformation">Custom state
117 type information
</a> is no longer available
</li>
119 <li>All states need to store one pointer less, leading to a
120 best-case state machine memory footprint reduction of about
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
135 <code>BOOST_STATECHART_RELAX_TRANSITION_CONTEXT
</code></td>
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>
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
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>
159 <p>Revised
05 January,
2008</p>
161 <p><i>Copyright
© 2003-
2008 <a href=
"contact.html">Andreas Huber
162 D
önni
</a></i></p>
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
167 "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt
</a>)
</i></p>