File: call.xml

package info (click to toggle)
boost1.42 1.42.0-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 277,864 kB
  • ctags: 401,076
  • sloc: cpp: 1,235,659; xml: 74,142; ansic: 41,313; python: 26,756; sh: 11,840; cs: 2,118; makefile: 655; perl: 494; yacc: 456; asm: 353; csh: 6
file content (190 lines) | stat: -rw-r--r-- 10,611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="utf-8"?>
<header name="boost/proto/transform/call.hpp">
  <para>Contains definition of the call&lt;&gt; transform. </para>
  <namespace name="boost">
    <namespace name="proto">
      <struct name="call">
        <template>
          <template-type-parameter name="T"/>
        </template>
        <purpose>Make the given <conceptname>CallableTransform</conceptname> into a <conceptname>PrimitiveTransform</conceptname>.</purpose>

        <description>
          <para>
            The purpose of <computeroutput>proto::call&lt;&gt;</computeroutput> is to annotate a transform as callable
            so that <computeroutput><classname alt="proto::when">proto::when&lt;&gt;</classname></computeroutput> knows
            how to apply it. The template parameter must be either a <conceptname>PrimitiveTransform</conceptname> or a
            <conceptname>CallableTransform</conceptname>; that is, a function type for which the return type is a callable
            <conceptname>PolymorphicFunctionObject</conceptname>.
          </para>

          <para>
            For the complete description of the behavior of the <computeroutput>proto::call&lt;&gt;</computeroutput>
            transform, see the documentation for the nested
            <computeroutput>
              <classname alt="proto::call::impl">proto::call::impl&lt;&gt;</classname>
            </computeroutput>
            class template.
          </para>
        </description>

        <inherit><type><classname>proto::transform</classname>&lt; call&lt;T&gt; &gt;</type></inherit>

        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><type><classname>proto::transform_impl</classname>&lt;Expr, State, Data&gt;</type></inherit>
          <typedef name="result_type">
            <type><replaceable>see-below</replaceable></type>
            <description>
              <para>
                <computeroutput><classname>proto::call</classname>&lt;T&gt;::impl&lt;Expr,State,Data&gt;::result_type</computeroutput>
                is computed as follows:
                <itemizedlist>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> if of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname></computeroutput> or
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>()</computeroutput>, then
                      <computeroutput>result_type</computeroutput> is:
                      <programlisting>typename boost::result_of&lt;PrimitiveTransform(Expr, State, Data)&gt;::type</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>)</computeroutput>, then
                      <computeroutput>result_type</computeroutput> is:
                      <programlisting>typename boost::result_of&lt;PrimitiveTransform(
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;(Expr, State, Data)&gt;::type,
  State, 
  Data
)&gt;::type</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>, A<subscript>1</subscript>)</computeroutput>, then
                      <computeroutput>result_type</computeroutput> is:
                      <programlisting>typename boost::result_of&lt;PrimitiveTransform(
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;(Expr, State, Data)&gt;::type,
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>1</subscript>&gt;(Expr, State, Data)&gt;::type,
  Data
)&gt;::type</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>, A<subscript>1</subscript>, A<subscript>2</subscript>)</computeroutput>, then
                      <computeroutput>result_type</computeroutput> is:
                      <programlisting>typename boost::result_of&lt;PrimitiveTransform(
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;(Expr, State, Data)&gt;::type,
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>1</subscript>&gt;(Expr, State, Data)&gt;::type,
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>2</subscript>&gt;(Expr, State, Data)&gt;::type
)&gt;::type</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PolymorphicFunctionObject</conceptname>(A<subscript>0</subscript>,...A<subscript>n</subscript>)</computeroutput>, then
                      <computeroutput>result_type</computeroutput> is:
                      <programlisting>typename boost::result_of&lt;PolymorphicFunctionObject(
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;(Expr, State, Data)&gt;::type,
  ...
  typename boost::result_of&lt;<classname>when</classname>&lt;<classname>_</classname>,A<subscript>n</subscript>&gt;(Expr, State, Data)&gt;::type
&gt;::type</programlisting>
                    </para>
                  </listitem>
                </itemizedlist>
              </para>
            </description>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>result_type</type>
              <parameter name="expr">
                <paramtype>typename impl::expr_param</paramtype>
              </parameter>
              <parameter name="state">
                <paramtype>typename impl::state_param</paramtype>
              </parameter>
              <parameter name="data">
                <paramtype>typename impl::data_param</paramtype>
              </parameter>
              <description>
              <para>
                <computeroutput><classname>proto::call</classname>&lt;T&gt;::impl&lt;Expr,State,Data&gt;::operator()</computeroutput> behaves as follows:
                <itemizedlist>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> if of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname></computeroutput> or
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>()</computeroutput>, then
                      return
                      <programlisting>PrimitiveTransform()(expr, state, data)</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>)</computeroutput>, then
                      return
                      <programlisting>PrimitiveTransform()(
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;()(expr, state, data),
  state, 
  sata
)</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>, A<subscript>1</subscript>)</computeroutput>, then
                      return:
                      <programlisting>PrimitiveTransform()(
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;()(expr, state, data),
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>1</subscript>&gt;()(expr, state, data),
  Data
)</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PrimitiveTransform</conceptname>(A<subscript>0</subscript>, A<subscript>1</subscript>, A<subscript>2</subscript>)</computeroutput>, then
                      return
                      <programlisting>PrimitiveTransform()(
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;()(expr, state, data),
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>1</subscript>&gt;()(expr, state, data),
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>2</subscript>&gt;()(expr, state, data)
)</programlisting>
                    </para>
                  </listitem>
                  <listitem>
                    <para>
                      If <computeroutput>T</computeroutput> is of the form
                      <computeroutput><conceptname>PolymorphicFunctionObject</conceptname>(A<subscript>0</subscript>,...A<subscript>n</subscript>)</computeroutput>, then
                      return:
                      <programlisting>PolymorphicFunctionObject()(
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>0</subscript>&gt;()(expr, state, data),
  ...
  <classname>when</classname>&lt;<classname>_</classname>,A<subscript>n</subscript>&gt;()(expr, state, data)
)</programlisting>
                    </para>
                  </listitem>
                </itemizedlist>
              </para>
              </description>
            </method>
          </method-group>
        </struct>
      </struct>
    </namespace>
  </namespace>
</header>