• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>UnaryGenerator</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="primitivegenerator.html" title="PrimitiveGenerator">
10<link rel="next" href="binarygenerator.html" title="BinaryGenerator">
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="primitivegenerator.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="binarygenerator.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.unarygenerator"></a><a class="link" href="unarygenerator.html" title="UnaryGenerator">UnaryGenerator</a>
28</h5></div></div></div>
29<h6>
30<a name="spirit.karma.reference.generator_concepts.unarygenerator.h0"></a>
31            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.description"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.description">Description</a>
32          </h6>
33<p>
34            <span class="emphasis"><em>UnaryGenerator</em></span> is a composite generator that has
35            a single subject. The UnaryGenerator may change the behavior of its subject
36            following the Delegate Design Pattern.
37          </p>
38<h6>
39<a name="spirit.karma.reference.generator_concepts.unarygenerator.h1"></a>
40            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.refinement_of"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.refinement_of">Refinement
41            of</a>
42          </h6>
43<div class="blockquote"><blockquote class="blockquote"><p>
44              <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>
45            </p></blockquote></div>
46<div class="variablelist">
47<p class="title"><b>Notation</b></p>
48<dl class="variablelist">
49<dt><span class="term"><code class="computeroutput"><span class="identifier">g</span></code></span></dt>
50<dd><p>
51                  A UnaryGenerator.
52                </p></dd>
53<dt><span class="term"><code class="computeroutput"><span class="identifier">G</span></code></span></dt>
54<dd><p>
55                  A UnaryGenerator type.
56                </p></dd>
57</dl>
58</div>
59<h6>
60<a name="spirit.karma.reference.generator_concepts.unarygenerator.h2"></a>
61            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.valid_expressions"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.valid_expressions">Valid
62            Expressions</a>
63          </h6>
64<p>
65            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 UnaryGenerator
66            the following must be met:
67          </p>
68<div class="informaltable"><table class="table">
69<colgroup>
70<col>
71<col>
72<col>
73</colgroup>
74<thead><tr>
75<th>
76                    <p>
77                      Expression
78                    </p>
79                  </th>
80<th>
81                    <p>
82                      Semantics
83                    </p>
84                  </th>
85<th>
86                    <p>
87                      Return type
88                    </p>
89                  </th>
90</tr></thead>
91<tbody><tr>
92<td>
93                    <p>
94                      <code class="computeroutput"><span class="identifier">g</span><span class="special">.</span><span class="identifier">subject</span></code>
95                    </p>
96                  </td>
97<td>
98                    <p>
99                      Subject generator.
100                    </p>
101                  </td>
102<td>
103                    <p>
104                      <a class="link" href="generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>
105                    </p>
106                  </td>
107</tr></tbody>
108</table></div>
109<h6>
110<a name="spirit.karma.reference.generator_concepts.unarygenerator.h3"></a>
111            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.type_expressions"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.type_expressions">Type
112            Expressions</a>
113          </h6>
114<div class="informaltable"><table class="table">
115<colgroup>
116<col>
117<col>
118</colgroup>
119<thead><tr>
120<th>
121                    <p>
122                      Expression
123                    </p>
124                  </th>
125<th>
126                    <p>
127                      Description
128                    </p>
129                  </th>
130</tr></thead>
131<tbody>
132<tr>
133<td>
134                    <p>
135                      <code class="computeroutput"><span class="identifier">G</span><span class="special">::</span><span class="identifier">subject_type</span></code>
136                    </p>
137                  </td>
138<td>
139                    <p>
140                      The subject generator type.
141                    </p>
142                  </td>
143</tr>
144<tr>
145<td>
146                    <p>
147                      <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_unary_generator</span><span class="special">&lt;</span><span class="identifier">G</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
148                    </p>
149                  </td>
150<td>
151                    <p>
152                      Metafunction that evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
153                      if a certain type, <code class="computeroutput"><span class="identifier">G</span></code>
154                      is a UnaryGenerator, <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code>
155                      otherwise (See <a href="../../../../../../../../libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL
156                      Boolean Constant</a>).
157                    </p>
158                  </td>
159</tr>
160</tbody>
161</table></div>
162<h6>
163<a name="spirit.karma.reference.generator_concepts.unarygenerator.h4"></a>
164            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.invariants"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.invariants">Invariants</a>
165          </h6>
166<p>
167            For any UnaryGenerator, <code class="computeroutput"><span class="identifier">G</span></code>,
168            the following invariant always holds:
169          </p>
170<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
171                <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">subject_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>
172              </li></ul></div>
173<h6>
174<a name="spirit.karma.reference.generator_concepts.unarygenerator.h5"></a>
175            <span class="phrase"><a name="spirit.karma.reference.generator_concepts.unarygenerator.models"></a></span><a class="link" href="unarygenerator.html#spirit.karma.reference.generator_concepts.unarygenerator.models">Models</a>
176          </h6>
177<p>
178            The following generators conform to this model:
179          </p>
180<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
181<li class="listitem">
182                <a class="link" href="../operator/kleene.html" title="Kleene Star Generator (*a)">Kleene Star
183                (unary <code class="computeroutput"><span class="special">*</span></code>)</a> operator,
184              </li>
185<li class="listitem">
186                <a class="link" href="../operator/plus.html" title="Plus Generator (+a)">Plus (unary
187                <code class="computeroutput"><span class="special">+</span></code>)</a> operator,
188              </li>
189<li class="listitem">
190                <a class="link" href="../operator/optional.html" title="Optional Generator (-a)">Optional
191                (unary <code class="computeroutput"><span class="special">-</span></code>)</a> operator,
192              </li>
193<li class="listitem">
194                <a class="link" href="../operator/and_predicate.html" title="And-Predicate Generator (&amp;a)">And
195                predicate (unary <code class="computeroutput"><span class="special">&amp;</span></code>)</a>
196                and <a class="link" href="../operator/not_predicate.html" title="Not-Predicate Generator (!a)">Not
197                predicate (unary <code class="computeroutput"><span class="special">!</span></code>)</a>
198                operators,
199              </li>
200<li class="listitem">
201                <a class="link" href="../directive/alignment.html" title="Alignment Generator Directives (left_align[], center[], right_align[])"><code class="computeroutput"><span class="identifier">left_align</span></code></a>, <a class="link" href="../directive/alignment.html" title="Alignment Generator Directives (left_align[], center[], right_align[])"><code class="computeroutput"><span class="identifier">center</span></code></a>, and <a class="link" href="../directive/alignment.html" title="Alignment Generator Directives (left_align[], center[], right_align[])"><code class="computeroutput"><span class="identifier">right_align</span></code></a> directives,
202              </li>
203<li class="listitem">
204                <a class="link" href="../directive/repeat.html" title="Repetition Generator Directive (repeat[])"><code class="computeroutput"><span class="identifier">repeat</span></code></a> directive,
205              </li>
206<li class="listitem">
207                <a class="link" href="../directive/delimit.html" title="Generator Directives Controlling Automatic Delimiting (verbatim[], no_delimit[], delimit[])"><code class="computeroutput"><span class="identifier">verbatim</span></code></a> directive,
208              </li>
209<li class="listitem">
210                <a class="link" href="../directive/delimit.html" title="Generator Directives Controlling Automatic Delimiting (verbatim[], no_delimit[], delimit[])"><code class="computeroutput"><span class="identifier">delimit</span></code></a> directive,
211              </li>
212<li class="listitem">
213                <a class="link" href="../directive/upperlower.html" title="Generator Directives Controlling Case Sensitivity (upper[], lower[])"><code class="computeroutput"><span class="identifier">lower</span></code></a> and <a class="link" href="../directive/upperlower.html" title="Generator Directives Controlling Case Sensitivity (upper[], lower[])"><code class="computeroutput"><span class="identifier">upper</span></code></a> directives,
214              </li>
215<li class="listitem">
216                <a class="link" href="../directive/maxwidth.html" title="Generator Directives Controlling the Maximum Field Width (maxwidth[])"><code class="computeroutput"><span class="identifier">maxwidth</span></code></a> directive,
217              </li>
218<li class="listitem">
219                <a class="link" href="../directive/buffer.html" title="Generator Directive for Temporary Output Buffering (buffer[])"><code class="computeroutput"><span class="identifier">buffer</span></code></a> directive,
220              </li>
221<li class="listitem">
222                <a class="link" href="../directive/omit.html" title="Generator Directives Consuming Attributes (omit[] and skip[])"><code class="computeroutput"><span class="identifier">omit</span></code></a> directive.
223              </li>
224</ul></div>
225<p>
226            <span class="bold"><strong>FIXME</strong></span> Add more links to models of UnaryGenerator
227            concept
228          </p>
229</div>
230<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
231<td align="left"></td>
232<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
233        Distributed under the Boost Software License, Version 1.0. (See accompanying
234        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>)
235      </p>
236</div></td>
237</tr></table>
238<hr>
239<div class="spirit-nav">
240<a accesskey="p" href="primitivegenerator.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="binarygenerator.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
241</div>
242</body>
243</html>
244