expr.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  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/expr.hpp">
  9. <namespace name="boost">
  10. <namespace name="proto">
  11. <!-- boost::proto::basic_expr -->
  12. <struct name="basic_expr">
  13. <template>
  14. <template-type-parameter name="Tag"/>
  15. <template-type-parameter name="Args"/>
  16. <template-nontype-parameter name="Arity">
  17. <type>long</type>
  18. <default>Args::arity</default>
  19. </template-nontype-parameter>
  20. </template>
  21. <purpose>Simplified representation of a node in an expression tree.</purpose>
  22. <description>
  23. <para>
  24. <computeroutput>proto::basic_expr&lt;&gt;</computeroutput> is a node in an expression
  25. template tree. It is a container for its child sub-trees. It also serves as the
  26. terminal nodes of the tree.
  27. </para>
  28. <para>
  29. <computeroutput>Tag</computeroutput> is type that represents the operation
  30. encoded by this expression. It is typically one of the structs in the
  31. <computeroutput>boost::proto::tag</computeroutput> namespace, but it doesn't
  32. have to be. If <computeroutput>Arity</computeroutput> is 0 then this
  33. <computeroutput>expr&lt;&gt;</computeroutput> type represents a leaf in the
  34. expression tree.
  35. </para>
  36. <para>
  37. <computeroutput>Args</computeroutput> is a list of types representing
  38. the children of this expression. It is an instantiation of one of
  39. <computeroutput><classname alt="proto::listN">proto::list1&lt;&gt;</classname></computeroutput>,
  40. <computeroutput><classname alt="proto::listN">proto::list2&lt;&gt;</classname></computeroutput>,
  41. etc. The child types
  42. must all themselves be either <computeroutput>proto::expr&lt;&gt;</computeroutput>
  43. or <computeroutput>proto::basic_expr&lt;&gt;&amp;</computeroutput> (or extensions thereof via
  44. <computeroutput><classname>proto::extends&lt;&gt;</classname></computeroutput> or
  45. <computeroutput><macroname>BOOST_PROTO_EXTENDS</macroname>()</computeroutput>), unless
  46. <computeroutput>Arity</computeroutput> is 0, in which case
  47. <computeroutput>Args</computeroutput> must be
  48. <computeroutput>proto::term&lt;T&gt;</computeroutput>, where
  49. <computeroutput>T</computeroutput> can be any type.
  50. </para>
  51. <para>
  52. <computeroutput>proto::basic_expr&lt;&gt;</computeroutput> is a valid Fusion
  53. random-access sequence, where the elements of the sequence are the child
  54. expressions.
  55. </para>
  56. </description>
  57. <!-- typedefs -->
  58. <typedef name="proto_tag">
  59. <type>Tag</type>
  60. </typedef>
  61. <typedef name="proto_args">
  62. <type>Args</type>
  63. </typedef>
  64. <typedef name="proto_arity">
  65. <type>mpl::long_&lt; Arity &gt;</type>
  66. </typedef>
  67. <typedef name="proto_domain">
  68. <type><classname>proto::basic_default_domain</classname></type>
  69. </typedef>
  70. <typedef name="proto_grammar">
  71. <type>basic_expr</type>
  72. </typedef>
  73. <typedef name="proto_base_expr">
  74. <type>basic_expr</type>
  75. </typedef>
  76. <typedef name="proto_derived_expr">
  77. <type>basic_expr</type>
  78. </typedef>
  79. <typedef name="proto_childN">
  80. <type>typename Args::child<replaceable>N</replaceable></type>
  81. <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(Arity,1))</replaceable>.</purpose>
  82. </typedef>
  83. <method-group name="public static functions">
  84. <!-- make -->
  85. <method name="make" specifiers="static">
  86. <type>basic_expr const</type>
  87. <template>
  88. <template-type-parameter name="A" pack="1"/>
  89. </template>
  90. <parameter name="a" pack="1">
  91. <paramtype>A const &amp;</paramtype>
  92. </parameter>
  93. <requires>
  94. <para>
  95. The number of supplied arguments must be <computeroutput>max(Arity,1)</computeroutput>.
  96. </para>
  97. </requires>
  98. <returns>
  99. <para>
  100. A new <computeroutput>basic_expr</computeroutput> object initialized with the specified arguments.
  101. </para>
  102. </returns>
  103. </method>
  104. </method-group>
  105. <method-group name="public member functions">
  106. <method name="proto_base">
  107. <type>basic_expr &amp;</type>
  108. <returns>
  109. <para>
  110. <computeroutput>*this</computeroutput>
  111. </para>
  112. </returns>
  113. </method>
  114. <method name="proto_base" cv="const">
  115. <type>basic_expr const &amp;</type>
  116. <description>
  117. <para>
  118. This is an overloaded member function, provided for convenience. It differs from
  119. the above function only in what argument(s) it accepts.
  120. </para>
  121. </description>
  122. </method>
  123. </method-group>
  124. </struct>
  125. <!-- boost::proto::expr -->
  126. <struct name="expr">
  127. <template>
  128. <template-type-parameter name="Tag"/>
  129. <template-type-parameter name="Args"/>
  130. <template-nontype-parameter name="Arity">
  131. <type>long</type>
  132. <default>Args::arity</default>
  133. </template-nontype-parameter>
  134. </template>
  135. <purpose>Representation of a node in an expression tree.</purpose>
  136. <description>
  137. <para>
  138. <computeroutput>proto::expr&lt;&gt;</computeroutput> is a node in an expression
  139. template tree. It is a container for its child sub-trees. It also serves as the
  140. terminal nodes of the tree.
  141. </para>
  142. <para>
  143. <computeroutput>Tag</computeroutput> is type that represents the operation
  144. encoded by this expression. It is typically one of the structs in the
  145. <computeroutput>boost::proto::tag</computeroutput> namespace, but it doesn't
  146. have to be. If <computeroutput>Arity</computeroutput> is 0 then this
  147. <computeroutput>expr&lt;&gt;</computeroutput> type represents a leaf in the
  148. expression tree.
  149. </para>
  150. <para>
  151. <computeroutput>Args</computeroutput> is a list of types representing
  152. the children of this expression. It is an instantiation of one of
  153. <computeroutput><classname alt="proto::listN">proto::list1&lt;&gt;</classname></computeroutput>,
  154. <computeroutput><classname alt="proto::listN">proto::list2&lt;&gt;</classname></computeroutput>,
  155. etc. The child types
  156. must all themselves be either <computeroutput>proto::expr&lt;&gt;</computeroutput>
  157. or <computeroutput>proto::basic_expr&lt;&gt;&amp;</computeroutput> (or extensions thereof via
  158. <computeroutput><classname>proto::extends&lt;&gt;</classname></computeroutput> or
  159. <computeroutput><macroname>BOOST_PROTO_EXTENDS</macroname>()</computeroutput>), unless
  160. <computeroutput>Arity</computeroutput> is 0, in which case
  161. <computeroutput>Args</computeroutput> must be
  162. <computeroutput>proto::term&lt;T&gt;</computeroutput>, where
  163. <computeroutput>T</computeroutput> can be any type.
  164. </para>
  165. <para>
  166. <computeroutput>proto::expr&lt;&gt;</computeroutput> is a valid Fusion
  167. random-access sequence, where the elements of the sequence are the child
  168. expressions.
  169. </para>
  170. </description>
  171. <!-- typedefs -->
  172. <typedef name="proto_tag">
  173. <type>Tag</type>
  174. </typedef>
  175. <typedef name="proto_args">
  176. <type>Args</type>
  177. </typedef>
  178. <typedef name="proto_arity">
  179. <type>mpl::long_&lt; Arity &gt;</type>
  180. </typedef>
  181. <typedef name="proto_domain">
  182. <type><classname>proto::default_domain</classname></type>
  183. </typedef>
  184. <typedef name="proto_grammar">
  185. <type><classname>proto::basic_expr</classname>&lt; Tag, Args, Arity &gt;</type>
  186. </typedef>
  187. <typedef name="proto_base_expr">
  188. <type>expr</type>
  189. </typedef>
  190. <typedef name="proto_derived_expr">
  191. <type>expr</type>
  192. </typedef>
  193. <typedef name="proto_childN">
  194. <type>typename Args::child<replaceable>N</replaceable></type>
  195. <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(Arity,1))</replaceable>.</purpose>
  196. </typedef>
  197. <struct name="result">
  198. <template>
  199. <template-type-parameter name="Signature"/>
  200. </template>
  201. <description>
  202. <para>
  203. Encodes the return type of <computeroutput><classname>proto::expr&lt;&gt;</classname>::operator()</computeroutput>.
  204. Makes <computeroutput><classname>proto::expr&lt;&gt;</classname></computeroutput> a TR1-style function object type
  205. usable with <computeroutput>boost::result_of&lt;&gt;</computeroutput>
  206. </para>
  207. </description>
  208. <typedef name="type">
  209. <type><replaceable>unspecified</replaceable></type>
  210. </typedef>
  211. </struct>
  212. <method-group name="public static functions">
  213. <!-- make -->
  214. <method name="make" specifiers="static">
  215. <type>expr const</type>
  216. <template>
  217. <template-type-parameter name="A" pack="1"/>
  218. </template>
  219. <parameter name="a" pack="1">
  220. <paramtype>A const &amp;</paramtype>
  221. </parameter>
  222. <requires>
  223. <para>
  224. The number of supplied arguments must be <computeroutput>max(Arity,1)</computeroutput>.
  225. </para>
  226. </requires>
  227. <returns>
  228. <para>
  229. A new <computeroutput>expr</computeroutput> object initialized with the specified arguments.
  230. </para>
  231. </returns>
  232. </method>
  233. </method-group>
  234. <method-group name="public member functions">
  235. <method name="proto_base">
  236. <type>expr &amp;</type>
  237. <returns><para><computeroutput>*this</computeroutput></para></returns>
  238. </method>
  239. <method name="proto_base" cv="const">
  240. <type>expr const &amp;</type>
  241. <description>
  242. <para>This is an overloaded member function, provided for convenience. It differs from
  243. the above function only in what argument(s) it accepts.</para>
  244. </description>
  245. </method>
  246. <!-- operator= -->
  247. <method name="operator=">
  248. <type><replaceable>unspecified</replaceable></type>
  249. <template>
  250. <template-type-parameter name="A"/>
  251. </template>
  252. <parameter name="a">
  253. <paramtype>A &amp;</paramtype>
  254. </parameter>
  255. <description>
  256. <para>Lazy assignment expression</para>
  257. </description>
  258. <returns>
  259. <para>A new expression node representing the assignment operation.</para>
  260. </returns>
  261. </method>
  262. <method name="operator=">
  263. <type><replaceable>unspecified</replaceable></type>
  264. <template>
  265. <template-type-parameter name="A"/>
  266. </template>
  267. <parameter name="a">
  268. <paramtype>A const &amp;</paramtype>
  269. </parameter>
  270. <description>
  271. <para>
  272. This is an overloaded member function, provided for convenience. It differs from
  273. the above function only in what argument(s) it accepts.
  274. </para>
  275. </description>
  276. </method>
  277. <method name="operator=" cv="const">
  278. <type><replaceable>unspecified</replaceable></type>
  279. <template>
  280. <template-type-parameter name="A"/>
  281. </template>
  282. <parameter name="a">
  283. <paramtype>A &amp;</paramtype>
  284. </parameter>
  285. <description>
  286. <para>
  287. This is an overloaded member function, provided for convenience. It differs from
  288. the above function only in what argument(s) it accepts.
  289. </para>
  290. </description>
  291. </method>
  292. <method name="operator=" cv="const">
  293. <type><replaceable>unspecified</replaceable></type>
  294. <template>
  295. <template-type-parameter name="A"/>
  296. </template>
  297. <parameter name="a">
  298. <paramtype>A const &amp;</paramtype>
  299. </parameter>
  300. <description>
  301. <para>
  302. This is an overloaded member function, provided for convenience. It differs from
  303. the above function only in what argument(s) it accepts.
  304. </para>
  305. </description>
  306. </method>
  307. <!-- operator[] -->
  308. <method name="operator[]">
  309. <type><replaceable>unspecified</replaceable></type>
  310. <template>
  311. <template-type-parameter name="A"/>
  312. </template>
  313. <parameter name="a">
  314. <paramtype>A &amp;</paramtype>
  315. </parameter>
  316. <description>
  317. <para>Lazy subscript expression</para>
  318. </description>
  319. <returns>
  320. <para>A new expression node representing the subscript operation.</para>
  321. </returns>
  322. </method>
  323. <method name="operator[]">
  324. <type><replaceable>unspecified</replaceable></type>
  325. <template>
  326. <template-type-parameter name="A"/>
  327. </template>
  328. <parameter name="a">
  329. <paramtype>A const &amp;</paramtype>
  330. </parameter>
  331. <description>
  332. <para>
  333. This is an overloaded member function, provided for convenience. It differs from
  334. the above function only in what argument(s) it accepts.
  335. </para>
  336. </description>
  337. </method>
  338. <method name="operator[]" cv="const">
  339. <type><replaceable>unspecified</replaceable></type>
  340. <template>
  341. <template-type-parameter name="A"/>
  342. </template>
  343. <parameter name="a">
  344. <paramtype>A &amp;</paramtype>
  345. </parameter>
  346. <description>
  347. <para>
  348. This is an overloaded member function, provided for convenience. It differs from
  349. the above function only in what argument(s) it accepts.
  350. </para>
  351. </description>
  352. </method>
  353. <method name="operator[]" cv="const">
  354. <type><replaceable>unspecified</replaceable></type>
  355. <template>
  356. <template-type-parameter name="A"/>
  357. </template>
  358. <parameter name="a">
  359. <paramtype>A const &amp;</paramtype>
  360. </parameter>
  361. <description>
  362. <para>
  363. This is an overloaded member function, provided for convenience. It differs from
  364. the above function only in what argument(s) it accepts.
  365. </para>
  366. </description>
  367. </method>
  368. <!-- operator() -->
  369. <method name="operator()">
  370. <type><replaceable>unspecified</replaceable></type>
  371. <template>
  372. <template-type-parameter name="A" pack="1"/>
  373. </template>
  374. <parameter name="a" pack="1">
  375. <paramtype>A const &amp;</paramtype>
  376. </parameter>
  377. <description>
  378. <para>Lazy function call</para>
  379. </description>
  380. <returns>
  381. <para>A new expression node representing the function call operation.</para>
  382. </returns>
  383. </method>
  384. <method name="operator()" cv="const">
  385. <type><replaceable>unspecified</replaceable></type>
  386. <template>
  387. <template-type-parameter name="A" pack="1"/>
  388. </template>
  389. <parameter name="a" pack="1">
  390. <paramtype>A const &amp;</paramtype>
  391. </parameter>
  392. <description>
  393. <para>
  394. This is an overloaded member function, provided for convenience. It differs from
  395. the above function only in what argument(s) it accepts.
  396. </para>
  397. </description>
  398. </method>
  399. </method-group>
  400. <data-member name="childN">
  401. <type>proto_child<replaceable>N</replaceable></type>
  402. <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(Arity,1))</replaceable>.</purpose>
  403. </data-member>
  404. <data-member name="proto_arity_c" specifiers="static">
  405. <type>const long</type>
  406. <purpose>
  407. <computeroutput>= Arity;</computeroutput>
  408. </purpose>
  409. </data-member>
  410. </struct>
  411. <!-- proto::unexpr -->
  412. <struct name="unexpr">
  413. <template>
  414. <template-type-parameter name="Expr"/>
  415. </template>
  416. <purpose>Lets you inherit the interface of an expression while hiding from Proto the fact that
  417. the type is a Proto expression.</purpose>
  418. <inherit><type>Expr</type></inherit>
  419. <method-group name="public member functions"/>
  420. <constructor>
  421. <parameter name="expr">
  422. <paramtype>Expr const &amp;</paramtype>
  423. </parameter>
  424. </constructor>
  425. <description>
  426. <para>
  427. For an expression type <computeroutput>E</computeroutput>,
  428. <computeroutput>
  429. <classname>proto::is_expr</classname>&lt;E&gt;::value
  430. </computeroutput> is <computeroutput>true</computeroutput>, but
  431. <computeroutput>
  432. <classname>proto::is_expr</classname>&lt;proto::unexpr&lt;E&gt; &gt;::value
  433. </computeroutput> is <computeroutput>false</computeroutput>.
  434. </para>
  435. </description>
  436. </struct>
  437. </namespace>
  438. </namespace>
  439. </header>