generate.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright 2012 Eric Niebler
  4. Distributed under the Boost
  5. Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <header name="boost/proto/generate.hpp">
  9. <para>Contains definition of
  10. <computeroutput><classname alt="boost::proto::default_generator">proto::default_generator</classname></computeroutput>,
  11. <computeroutput><classname alt="boost::proto::generator">proto::generator</classname>&lt;&gt;</computeroutput>,
  12. <computeroutput><classname alt="boost::proto::pod_generator">proto::pod_generator</classname>&lt;&gt;</computeroutput>
  13. and other utilities that users can use to post-process new expression objects that
  14. Proto creates.</para>
  15. <namespace name="boost">
  16. <namespace name="proto">
  17. <!-- proto::default_generator -->
  18. <struct name="default_generator">
  19. <purpose>A simple generator that passes an expression through unchanged.</purpose>
  20. <description>
  21. <para>
  22. Generators are intended for use as the first template parameter to the
  23. <computeroutput><classname alt="proto::domain">proto::domain&lt;&gt;</classname></computeroutput>
  24. class template and control if and how expressions within that domain are to be customized.
  25. The <computeroutput>proto::default_generator</computeroutput> makes no modifications to the
  26. expressions passed to it.
  27. </para>
  28. </description>
  29. <inherit>
  30. <type><classname>proto::callable</classname></type>
  31. </inherit>
  32. <struct-specialization name="result">
  33. <template>
  34. <template-type-parameter name="This"/>
  35. <template-type-parameter name="Expr"/>
  36. </template>
  37. <specialization>
  38. <template-arg>This(Expr)</template-arg>
  39. </specialization>
  40. <typedef name="type">
  41. <type>Expr</type>
  42. </typedef>
  43. </struct-specialization>
  44. <method-group name="public member functions">
  45. <method name="operator()" cv="const">
  46. <type>Expr</type>
  47. <template>
  48. <template-type-parameter name="Expr"/>
  49. </template>
  50. <parameter name="expr">
  51. <paramtype>Expr const &amp;</paramtype>
  52. <description>
  53. <para>A Proto expression</para>
  54. </description>
  55. </parameter>
  56. <returns>
  57. <para><computeroutput>expr</computeroutput></para>
  58. </returns>
  59. </method>
  60. </method-group>
  61. </struct>
  62. <!-- proto::basic_default_generator -->
  63. <struct name="basic_default_generator">
  64. <purpose>
  65. A simple generator that passes an expression through unchanged while stating
  66. a preference for <classname>proto::basic_expr</classname>&lt;&gt; over
  67. <classname>proto::expr</classname>&lt;&gt;.</purpose>
  68. <inherit>
  69. <type><classname>proto::use_basic_expr</classname>&lt; <classname>proto::default_generator</classname> &gt;</type>
  70. </inherit>
  71. </struct>
  72. <!-- proto::generator -->
  73. <struct name="generator">
  74. <template>
  75. <template-nontype-parameter name="Extends">
  76. <type>template&lt; typename &gt; class</type>
  77. </template-nontype-parameter>
  78. </template>
  79. <purpose>A generator that wraps expressions passed to it in the specified extension wrapper.</purpose>
  80. <description>
  81. <para>
  82. Generators are intended for use as the first template parameter to the
  83. <computeroutput><classname alt="proto::domain">proto::domain&lt;&gt;</classname></computeroutput>
  84. class template and control if and how expressions within that domain are to be customized.
  85. <computeroutput>proto::generator&lt;&gt;</computeroutput> wraps each expression passed to it in
  86. the <computeroutput>Extends&lt;&gt;</computeroutput> wrapper.
  87. </para>
  88. </description>
  89. <struct-specialization name="result">
  90. <template>
  91. <template-type-parameter name="This"/>
  92. <template-type-parameter name="Expr"/>
  93. </template>
  94. <specialization>
  95. <template-arg>This(Expr)</template-arg>
  96. </specialization>
  97. <typedef name="type">
  98. <type>Extends&lt; Expr &gt;</type>
  99. </typedef>
  100. </struct-specialization>
  101. <method-group name="public member functions">
  102. <method name="operator()" cv="const">
  103. <type>Extends&lt; Expr &gt;</type>
  104. <template>
  105. <template-type-parameter name="Expr"/>
  106. </template>
  107. <parameter name="expr">
  108. <paramtype>Expr const &amp;</paramtype>
  109. <description>
  110. <para>A Proto expression</para>
  111. </description>
  112. </parameter>
  113. <returns>
  114. <para><computeroutput>Extends&lt;Expr&gt;(expr)</computeroutput></para>
  115. </returns>
  116. </method>
  117. </method-group>
  118. </struct>
  119. <!-- proto::pod_generator -->
  120. <struct name="pod_generator">
  121. <template>
  122. <template-nontype-parameter name="Extends">
  123. <type>template&lt; typename &gt; class</type>
  124. </template-nontype-parameter>
  125. </template>
  126. <purpose>A generator that wraps expressions passed to it in the specified extension wrapper and uses aggregate initialization for the wrapper. </purpose>
  127. <description>
  128. <para>
  129. Generators are intended for use as the first template parameter to the
  130. <computeroutput><classname alt="proto::domain">proto::domain&lt;&gt;</classname></computeroutput>
  131. class template and control if and how expressions within that domain are to be customized.
  132. <computeroutput>proto::pod_generator&lt;&gt;</computeroutput> wraps each expression passed
  133. to it in the <computeroutput>Extends&lt;&gt;</computeroutput> wrapper, and uses aggregate
  134. initialzation for the wrapped object.
  135. </para>
  136. </description>
  137. <inherit>
  138. <type><classname>proto::callable</classname></type>
  139. </inherit>
  140. <struct-specialization name="result">
  141. <template>
  142. <template-type-parameter name="This"/>
  143. <template-type-parameter name="Expr"/>
  144. </template>
  145. <specialization>
  146. <template-arg>This(Expr)</template-arg>
  147. </specialization>
  148. <typedef name="type">
  149. <type>Extends&lt; Expr &gt;</type>
  150. </typedef>
  151. </struct-specialization>
  152. <method-group name="public member functions">
  153. <method name="operator()" cv="const">
  154. <type>Extends&lt; Expr &gt;</type>
  155. <template>
  156. <template-type-parameter name="Expr"/>
  157. </template>
  158. <parameter name="expr">
  159. <paramtype>Expr const &amp;</paramtype>
  160. <description>
  161. <para>A Proto expression</para>
  162. </description>
  163. </parameter>
  164. <returns>
  165. <para>
  166. <computeroutput>Extends&lt;Expr&gt; that = {expr}; return that;</computeroutput>
  167. </para>
  168. </returns>
  169. </method>
  170. </method-group>
  171. </struct>
  172. <!-- by_value_generator -->
  173. <struct name="by_value_generator">
  174. <purpose>A generator that replaces child nodes held by reference with ones held by value.
  175. Use with <computeroutput><classname alt="proto::compose_generators">proto::compose_generators&lt;&gt;</classname>
  176. </computeroutput> to forward that result to another generator.
  177. </purpose>
  178. <description>
  179. <para>
  180. Generators are intended for use as the first template parameter to the
  181. <computeroutput><classname alt="proto::domain">proto::domain&lt;&gt;</classname></computeroutput>
  182. class template and control if and how expressions within that domain are to be customized.
  183. <computeroutput>proto::by_value_generator</computeroutput> ensures all child nodes are held
  184. by value. This generator is typically composed with a second generator for further processing,
  185. as <computeroutput><classname>proto::compose_generators</classname>&lt;proto::by_value_generator,
  186. MyGenerator&gt;</computeroutput>.
  187. </para>
  188. </description>
  189. <inherit>
  190. <type><classname>proto::callable</classname></type>
  191. </inherit>
  192. <struct-specialization name="result">
  193. <template>
  194. <template-type-parameter name="This"/>
  195. <template-type-parameter name="Expr"/>
  196. </template>
  197. <specialization>
  198. <template-arg>This(Expr)</template-arg>
  199. </specialization>
  200. <typedef name="type">
  201. <type><emphasis>unspecified</emphasis></type>
  202. </typedef>
  203. </struct-specialization>
  204. <method-group name="public member functions">
  205. <method name="operator()" cv="const">
  206. <type><emphasis>unspecified</emphasis></type>
  207. <template>
  208. <template-type-parameter name="Expr"/>
  209. </template>
  210. <parameter name="expr">
  211. <paramtype>Expr const &amp;</paramtype>
  212. <description>
  213. <para>A Proto expression.</para>
  214. </description>
  215. </parameter>
  216. <returns>
  217. <para>Equivalent to <computeroutput><functionname>proto::deep_copy</functionname>(expr)</computeroutput></para>
  218. </returns>
  219. </method>
  220. </method-group>
  221. </struct>
  222. <!-- proto::compose_generator -->
  223. <struct name="compose_generators">
  224. <template>
  225. <template-type-parameter name="First"/>
  226. <template-type-parameter name="Second"/>
  227. </template>
  228. <purpose>A composite generator that first applies one transform to an expression and then forwards
  229. the result on to another generator for further transformation.</purpose>
  230. <description>
  231. <para>
  232. Generators are intended for use as the first template parameter to the
  233. <computeroutput><classname alt="proto::domain">proto::domain&lt;&gt;</classname></computeroutput>
  234. class template and control if and how expressions within that domain are to be customized.
  235. <computeroutput>proto::compose_generators&lt;&gt;</computeroutput> is a composite generator
  236. that first applies one transform to an expression and then forwards the result on to another
  237. generator for further transformation.
  238. </para>
  239. </description>
  240. <inherit>
  241. <type><classname>proto::callable</classname></type>
  242. </inherit>
  243. <struct-specialization name="result">
  244. <template>
  245. <template-type-parameter name="This"/>
  246. <template-type-parameter name="Expr"/>
  247. </template>
  248. <specialization>
  249. <template-arg>This(Expr)</template-arg>
  250. </specialization>
  251. <inherit>
  252. <type>
  253. boost::result_of&lt;
  254. Second(typename boost::result_of&lt;First(Expr)&gt;::type)
  255. &gt;</type>
  256. </inherit>
  257. </struct-specialization>
  258. <method-group name="public member functions">
  259. <method name="operator()" cv="const">
  260. <type>typename boost::result_of&lt;
  261. Second(typename boost::result_of&lt;First(Expr)&gt;::type)
  262. &gt;::type</type>
  263. <template>
  264. <template-type-parameter name="Expr"/>
  265. </template>
  266. <parameter name="expr">
  267. <paramtype>Expr const &amp;</paramtype>
  268. <description>
  269. <para>A Proto expression.</para>
  270. </description>
  271. </parameter>
  272. <returns>
  273. <para><computeroutput>Second()(First()(expr))</computeroutput></para>
  274. </returns>
  275. </method>
  276. </method-group>
  277. </struct>
  278. <!-- proto::use_basic_expr -->
  279. <struct name="use_basic_expr">
  280. <template>
  281. <template-type-parameter name="Generator"/>
  282. </template>
  283. <inherit>
  284. <type>Generator</type>
  285. </inherit>
  286. <description>
  287. <para>
  288. Annotate a generator to indicate that it would
  289. prefer to be passed instances of
  290. <computeroutput><classname>proto::basic_expr</classname>&lt;&gt;</computeroutput> rather than
  291. <computeroutput><classname>proto::expr</classname>&lt;&gt;</computeroutput>.
  292. </para>
  293. <para>
  294. <computeroutput>use_basic_expr&lt; Generator &gt;</computeroutput> is itself a generator.
  295. </para>
  296. </description>
  297. </struct>
  298. <!-- proto::wants_basic_expr -->
  299. <struct name="wants_basic_expr">
  300. <template>
  301. <template-type-parameter name="Generator"/>
  302. </template>
  303. <inherit>
  304. <type>mpl::bool_&lt; <replaceable>true-or-false</replaceable> &gt;</type>
  305. </inherit>
  306. <description>
  307. <para>
  308. A Boolean metafunction that tests a generator to see whether
  309. it would prefer to be passed instances of
  310. <computeroutput><classname>proto::basic_expr</classname>&lt;&gt;</computeroutput> rather than
  311. <computeroutput><classname>proto::expr</classname>&lt;&gt;</computeroutput>.
  312. </para>
  313. </description>
  314. </struct>
  315. </namespace>
  316. </namespace>
  317. </header>