• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>BinaryGenerator</title>
5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../../../index.html" title="Spirit 2.5.8">
8<link rel="up" href="../generator_concepts.html" title="Generator Concepts">
9<link rel="prev" href="unarygenerator.html" title="UnaryGenerator">
10<link rel="next" href="narygenerator.html" title="NaryGenerator">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="unarygenerator.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../generator_concepts.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="narygenerator.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h5 class="title">
27<a name="spirit.karma.reference.generator_concepts.binarygenerator"></a><a class="link" href="binarygenerator.html" title="BinaryGenerator">BinaryGenerator</a>
28</h5></div></div></div>
29<h6>
30<a name="spirit.karma.reference.generator_concepts.binarygenerator.h0"></a>
31            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.description"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.description">Description</a>
32          </h6>
33<p>
34            <span class="emphasis"><em>BinaryGenerator</em></span> is a composite generator that has
35            a two subjects, <code class="computeroutput"><span class="identifier">left</span></code>
36            and <code class="computeroutput"><span class="identifier">right</span></code>. The BinaryGenerator
37            allows its subjects to be treated in the same way as a single instance
38            of a <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a> following the Composite
39            Design Pattern.
40          </p>
41<h6>
42<a name="spirit.karma.reference.generator_concepts.binarygenerator.h1"></a>
43            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.refinement_of"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.refinement_of">Refinement
44            of</a>
45          </h6>
46<div class="blockquote"><blockquote class="blockquote"><p>
47              <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>
48            </p></blockquote></div>
49<div class="variablelist">
50<p class="title"><b>Notation</b></p>
51<dl class="variablelist">
52<dt><span class="term"><code class="computeroutput"><span class="identifier">g</span></code></span></dt>
53<dd><p>
54                  A BinaryGenerator.
55                </p></dd>
56<dt><span class="term"><code class="computeroutput"><span class="identifier">G</span></code></span></dt>
57<dd><p>
58                  A BinaryGenerator type.
59                </p></dd>
60</dl>
61</div>
62<h6>
63<a name="spirit.karma.reference.generator_concepts.binarygenerator.h2"></a>
64            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.valid_expressions"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.valid_expressions">Valid
65            Expressions</a>
66          </h6>
67<p>
68            In addition to the requirements defined in <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>, for any BinaryGenerator
69            the following must be met:
70          </p>
71<div class="informaltable"><table class="table">
72<colgroup>
73<col>
74<col>
75<col>
76</colgroup>
77<thead><tr>
78<th>
79                    <p>
80                      Expression
81                    </p>
82                  </th>
83<th>
84                    <p>
85                      Semantics
86                    </p>
87                  </th>
88<th>
89                    <p>
90                      Return type
91                    </p>
92                  </th>
93</tr></thead>
94<tbody>
95<tr>
96<td>
97                    <p>
98                      <code class="computeroutput"><span class="identifier">g</span><span class="special">.</span><span class="identifier">left</span></code>
99                    </p>
100                  </td>
101<td>
102                    <p>
103                      Left generator.
104                    </p>
105                  </td>
106<td>
107                    <p>
108                      <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>
109                    </p>
110                  </td>
111</tr>
112<tr>
113<td>
114                    <p>
115                      <code class="computeroutput"><span class="identifier">g</span><span class="special">.</span><span class="identifier">right</span></code>
116                    </p>
117                  </td>
118<td>
119                    <p>
120                      Right generator.
121                    </p>
122                  </td>
123<td>
124                    <p>
125                      <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>
126                    </p>
127                  </td>
128</tr>
129</tbody>
130</table></div>
131<h6>
132<a name="spirit.karma.reference.generator_concepts.binarygenerator.h3"></a>
133            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.type_expressions"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.type_expressions">Type
134            Expressions</a>
135          </h6>
136<div class="informaltable"><table class="table">
137<colgroup>
138<col>
139<col>
140</colgroup>
141<thead><tr>
142<th>
143                    <p>
144                      Expression
145                    </p>
146                  </th>
147<th>
148                    <p>
149                      Description
150                    </p>
151                  </th>
152</tr></thead>
153<tbody>
154<tr>
155<td>
156                    <p>
157                      <code class="computeroutput"><span class="identifier">G</span><span class="special">::</span><span class="identifier">left_type</span></code>
158                    </p>
159                  </td>
160<td>
161                    <p>
162                      The left generator type.
163                    </p>
164                  </td>
165</tr>
166<tr>
167<td>
168                    <p>
169                      <code class="computeroutput"><span class="identifier">G</span><span class="special">::</span><span class="identifier">right_type</span></code>
170                    </p>
171                  </td>
172<td>
173                    <p>
174                      The right generator type.
175                    </p>
176                  </td>
177</tr>
178<tr>
179<td>
180                    <p>
181                      <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_binary_generator</span><span class="special">&lt;</span><span class="identifier">G</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
182                    </p>
183                  </td>
184<td>
185                    <p>
186                      Metafunction that evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
187                      if a certain type, <code class="computeroutput"><span class="identifier">G</span></code>
188                      is a BinaryGenerator, <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code>
189                      otherwise (See <a href="../../../../../../../../libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL
190                      Boolean Constant</a>).
191                    </p>
192                  </td>
193</tr>
194</tbody>
195</table></div>
196<h6>
197<a name="spirit.karma.reference.generator_concepts.binarygenerator.h4"></a>
198            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.invariants"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.invariants">Invariants</a>
199          </h6>
200<p>
201            For any BinaryGenerator, <code class="computeroutput"><span class="identifier">G</span></code>,
202            the following invariants always hold:
203          </p>
204<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
205<li class="listitem">
206                <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_generator</span><span class="special">&lt;</span><span class="identifier">G</span><span class="special">::</span><span class="identifier">left_type</span><span class="special">&gt;::</span><span class="identifier">type</span></code> evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
207              </li>
208<li class="listitem">
209                <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_generator</span><span class="special">&lt;</span><span class="identifier">G</span><span class="special">::</span><span class="identifier">right_type</span><span class="special">&gt;::</span><span class="identifier">type</span></code> evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
210              </li>
211</ul></div>
212<h6>
213<a name="spirit.karma.reference.generator_concepts.binarygenerator.h5"></a>
214            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.binarygenerator.models"></a></span><a class="link" href="binarygenerator.html#spirit.karma.reference.generator_concepts.binarygenerator.models">Models</a>
215          </h6>
216<p>
217            The following generators conform to this model:
218          </p>
219<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
220                <a class="link" href="../operator/list.html" title="List Generator (a % b)">List (<code class="computeroutput"><span class="special">%</span></code>)</a>.
221              </li></ul></div>
222<p>
223            <span class="bold"><strong>FIXME</strong></span> Add more links to models of BinaryGenerator
224            concept
225          </p>
226</div>
227<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
228<td align="left"></td>
229<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
230        Distributed under the Boost Software License, Version 1.0. (See accompanying
231        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
232      </p>
233</div></td>
234</tr></table>
235<hr>
236<div class="spirit-nav">
237<a accesskey="p" href="unarygenerator.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../generator_concepts.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="narygenerator.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
238</div>
239</body>
240</html>
241