3 Copyright 2010 Eric Niebler
5 Distributed under the Boost
6 Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 <concept name=
"Domain" category=
"utility">
10 <param name=
"Domain" role=
"domain-type" />
11 <param name=
"Expr" role=
"expression-type" />
12 <param name=
"Object" role=
"object-type" />
15 The type
<arg num=
"1" /> must be a model of
<self/>. It also
16 models Unary Polymorphic Function.
20 The type
<arg num=
"2" /> must be a model of
<conceptname>Expr
</conceptname>
25 A Domain creates an association between expressions and a so-called
26 generator, which is a function that maps an expression in the default
27 domain to an equivalent expression in this Domain. It also associates
28 an expression with a grammar, to which all expressions within this
33 <notation variables=
"d">
35 <type name=
"Domain" />
39 <notation variables=
"e">
45 <notation variables=
"o">
47 <type name=
"Object" />
51 <associated-type name=
"proto_grammar">
52 <get-member-type name=
"proto_grammar">
56 <simpara>The grammar to which every expression in this Domain
57 must conform.
</simpara>
61 <associated-type name=
"proto_generator">
62 <get-member-type name=
"proto_generator">
67 A Unary Polymorphic Function that accepts expressions in the
68 default domain and emits expressions in this Domain.
73 <associated-type name=
"proto_super_domain">
74 <get-member-type name=
"proto_super_domain">
79 The Domain that is a super-domain of this domain, if
80 any such domain exists. If not, it is some unspecified
86 <associated-type name=
"result_type">
87 <get-member-type name=
"type">
88 <apply-template name=
"boost::result_of">
89 <type name=
"Domain(Expr)"/>
94 The type of the result of applying
95 <computeroutput>proto_generator
</computeroutput> to
96 the specified expression type. The result is required to
97 model
<conceptname>Expr
</conceptname>. The domain type
98 associated with
<computeroutput>result_type
</computeroutput>
99 (
<computeroutput>result_type::proto_domain
</computeroutput>)
100 is required to be the same type as this Domain.
105 <associated-type name=
"as_expr_result_type">
106 <get-member-type name=
"result_type">
107 <apply-template name=
"Domain::as_expr">
108 <type name=
"Object"/>
113 The result of converting some type to a Proto expression
114 type in this domain. This is used, for instance, when
115 calculating the type of a variable to hold a Proto
117 <computeroutput>as_expr_result_type
</computeroutput>
119 <computeroutput><conceptname>Expr
</conceptname></computeroutput>.
124 <associated-type name=
"as_child_result_type">
125 <get-member-type name=
"result_type">
126 <apply-template name=
"Domain::as_child">
127 <type name=
"Object"/>
132 The result of converting some type to a Proto expression
133 type in this domain. This is used, for instance, to
134 compute the type of an object suitable for storage
135 as a child in an expression tree.
136 <computeroutput>as_child_result_type
</computeroutput>
138 <computeroutput><conceptname>Expr
</conceptname></computeroutput>.
143 <valid-expression name=
"Apply Generator">
144 <apply-function name=
"d">
150 <require-same-type testable=
"yes">
151 <type name=
"result_type"/>
155 The result of applying
<computeroutput>proto_generator
</computeroutput>
156 to the specified expression.
160 <valid-expression name=
"As Expression">
161 <apply-function name=
"Domain::as_expr< Object >()">
163 <type name=
"Object"/>
167 <require-same-type testable=
"yes">
168 <type name=
"as_expr_result_type"/>
172 The result of converting some object to a Proto expression
173 in this domain. It returns a Proto expression object that
174 is suitable for storage in a variable. It should return a
175 new object, which may be a copy of the object passed in.
179 <valid-expression name=
"As Child">
180 <apply-function name=
"Domain::as_child< Object >()">
182 <type name=
"Object"/>
186 <require-same-type testable=
"yes">
187 <type name=
"as_child_result_type"/>
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.
199 <type name=
"boost::proto::default_domain" />