• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>Concept Domain</title>
6<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9<link rel="up" href="proto/reference.html" title="Reference">
10<link rel="prev" href="CallableTransform.html" title="Concept CallableTransform">
11<link rel="next" href="Expr.html" title="Concept Expr">
12</head>
13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14<table cellpadding="2" width="100%"><tr>
15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
16<td align="center"><a href="../../index.html">Home</a></td>
17<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20<td align="center"><a href="../../more/index.htm">More</a></td>
21</tr></table>
22<hr>
23<div class="spirit-nav">
24<a accesskey="p" href="CallableTransform.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="proto/reference.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="Expr.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="Domain"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Concept Domain</span></h2>
30<p>Domain</p>
31</div>
32<div class="refsect1">
33<a name="id-1.3.33.5.60.3"></a><h2>Description</h2>
34<p>
35      A Domain creates an association between expressions and a so-called
36      generator, which is a function that maps an expression in the default
37      domain to an equivalent expression in this Domain. It also associates
38      an expression with a grammar, to which all expressions within this
39      Domain must conform.
40    </p>
41</div>
42<div class="refsect1">
43<a name="id-1.3.33.5.60.4"></a><h2>Associated types</h2>
44<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
45<li class="listitem">
46<p><span class="bold"><strong>proto_grammar</strong></span></p>
47<pre class="literallayout">Domain::proto_grammar</pre>
48<p>
49      </p>
50<p>The grammar to which every expression in this Domain
51        must conform.</p>
52<p>
53    </p>
54</li>
55<li class="listitem">
56<p><span class="bold"><strong>proto_generator</strong></span></p>
57<pre class="literallayout">Domain::proto_generator</pre>
58<p>
59      </p>
60<p>
61        A Unary Polymorphic Function that accepts expressions in the
62        default domain and emits expressions in this Domain.
63      </p>
64<p>
65    </p>
66</li>
67<li class="listitem">
68<p><span class="bold"><strong>proto_super_domain</strong></span></p>
69<pre class="literallayout">Domain::proto_super_domain</pre>
70<p>
71      </p>
72<p>
73        The Domain that is a super-domain of this domain, if
74        any such domain exists. If not, it is some unspecified
75        type.
76      </p>
77<p>
78    </p>
79</li>
80<li class="listitem">
81<p><span class="bold"><strong>result_type</strong></span></p>
82<pre class="literallayout">boost::result_of&lt;Domain(Expr)&gt;::type</pre>
83<p>
84      </p>
85<p>
86        The type of the result of applying
87        <code class="computeroutput">proto_generator</code> to
88        the specified expression type. The result is required to
89        model <a class="link" href="Expr.html" title="Concept Expr">Expr</a>. The domain type
90        associated with <code class="computeroutput">result_type</code>
91        (<code class="computeroutput">result_type::proto_domain</code>)
92        is required to be the same type as this Domain.
93      </p>
94<p>
95    </p>
96</li>
97<li class="listitem">
98<p><span class="bold"><strong>as_expr_result_type</strong></span></p>
99<pre class="literallayout">Domain::as_expr&lt;Object&gt;::result_type</pre>
100<p>
101      </p>
102<p>
103        The result of converting some type to a Proto expression
104        type in this domain. This is used, for instance, when
105        calculating the type of a variable to hold a Proto
106        expression.
107        <code class="computeroutput">as_expr_result_type</code>
108        models
109        <code class="computeroutput"><a class="link" href="Expr.html" title="Concept Expr">Expr</a></code>.
110      </p>
111<p>
112    </p>
113</li>
114<li class="listitem">
115<p><span class="bold"><strong>as_child_result_type</strong></span></p>
116<pre class="literallayout">Domain::as_child&lt;Object&gt;::result_type</pre>
117<p>
118      </p>
119<p>
120        The result of converting some type to a Proto expression
121        type in this domain. This is used, for instance, to
122        compute the type of an object suitable for storage
123        as a child in an expression tree.
124        <code class="computeroutput">as_child_result_type</code>
125        models
126        <code class="computeroutput"><a class="link" href="Expr.html" title="Concept Expr">Expr</a></code>.
127      </p>
128<p>
129    </p>
130</li>
131</ul></div>
132</div>
133<div class="refsect1">
134<a name="id-1.3.33.5.60.5"></a><h2>Notation</h2>
135<div class="variablelist"><dl class="variablelist">
136<dt><span class="term">Domain</span></dt>
137<dd>A type playing the role of domain-type in the <a class="link" href="Domain.html" title="Concept Domain">Domain</a> concept.</dd>
138<dt><span class="term">Expr</span></dt>
139<dd>A type playing the role of expression-type in the <a class="link" href="Domain.html" title="Concept Domain">Domain</a> concept.</dd>
140<dt><span class="term">Object</span></dt>
141<dd>A type playing the role of object-type in the <a class="link" href="Domain.html" title="Concept Domain">Domain</a> concept.</dd>
142<dt><span class="term"><code class="varname">d</code></span></dt>
143<dd>Object of type Domain</dd>
144<dt><span class="term"><code class="varname">e</code></span></dt>
145<dd>Object of type Expr</dd>
146<dt><span class="term"><code class="varname">o</code></span></dt>
147<dd>Object of type Object</dd>
148</dl></div>
149</div>
150<div class="refsect1">
151<a name="id-1.3.33.5.60.6"></a><h2>Valid expressions</h2>
152<div class="informaltable"><table class="table">
153<colgroup>
154<col>
155<col>
156<col>
157<col>
158</colgroup>
159<thead><tr>
160<th>Name</th>
161<th>Expression</th>
162<th>Type</th>
163<th>Semantics</th>
164</tr></thead>
165<tbody>
166<tr>
167<td><p>Apply Generator</p></td>
168<td><p>d(e)</p></td>
169<td><p><span class="type">result_type</span></p></td>
170<td><p>
171      The result of applying <code class="computeroutput">proto_generator</code>
172      to the specified expression.
173    </p></td>
174</tr>
175<tr>
176<td><p>As Expression</p></td>
177<td><p>Domain::as_expr&lt; Object &gt;()(o)</p></td>
178<td><p><span class="type">as_expr_result_type</span></p></td>
179<td><p>
180      The result of converting some object to a Proto expression
181      in this domain. It returns a Proto expression object that
182      is suitable for storage in a variable. It should return a
183      new object, which may be a copy of the object passed in.
184    </p></td>
185</tr>
186<tr>
187<td><p>As Child</p></td>
188<td><p>Domain::as_child&lt; Object &gt;()(o)</p></td>
189<td><p><span class="type">as_child_result_type</span></p></td>
190<td><p>
191      The result of converting some object to a Proto expression
192      in this domain. It returns an object suitable for storage
193      as a child in an expression tree, which may simply be a
194      reference to the object passed in.
195    </p></td>
196</tr>
197</tbody>
198</table></div>
199</div>
200<div class="refsect1">
201<a name="id-1.3.33.5.60.7"></a><h2>Models</h2>
202<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="simplelist"><span class="type">boost::proto::default_domain</span></span></li></ul></div>
203</div>
204</div>
205<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
206<td align="left"></td>
207<td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p>
208        Distributed under the Boost Software License, Version 1.0. (See accompanying
209        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>)
210      </p>
211</div></td>
212</tr></table>
213<hr>
214<div class="spirit-nav">
215<a accesskey="p" href="CallableTransform.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="proto/reference.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="Expr.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
216</div>
217</body>
218</html>
219