/Src/Dependencies/Boost/libs/phoenix/doc/html/phoenix/actor.html

http://hadesmem.googlecode.com/ · HTML · 90 lines · 87 code · 3 blank · 0 comment · 0 complexity · dd3ee98065ff5641094983939fa3634d MD5 · raw file

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Actor</title>
  5. <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
  7. <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
  8. <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
  9. <link rel="prev" href="organization.html" title="Organization">
  10. <link rel="next" href="modules.html" title="Modules">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="organization.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="modules.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  27. <a name="phoenix.actor"></a><a class="link" href="actor.html" title="Actor">Actor</a>
  28. </h2></div></div></div>
  29. <p>
  30. The <code class="computeroutput"><span class="identifier">Actor</span></code> is the main concept
  31. behind the library. Actors are function objects. An actor can accept 0 to
  32. <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_LIMIT</span></code> arguments.
  33. </p>
  34. <div class="note"><table border="0" summary="Note">
  35. <tr>
  36. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/src/images/note.png"></td>
  37. <th align="left">Note</th>
  38. </tr>
  39. <tr><td align="left" valign="top"><p>
  40. You can set <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_LIMIT</span></code>,
  41. the predefined maximum arity an actor can take. By default, <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_LIMIT</span></code> is set to 10.
  42. </p></td></tr>
  43. </table></div>
  44. <p>
  45. Phoenix supplies an <code class="computeroutput"><span class="identifier">actor</span></code> class
  46. template whose specializations model the <code class="computeroutput"><span class="identifier">Actor</span></code>
  47. concept. <code class="computeroutput"><span class="identifier">actor</span></code> has one template
  48. parameter, <code class="computeroutput"><span class="identifier">Expr</span></code>, that supplies
  49. the underlying expression to evaluate.
  50. </p>
  51. <pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Expr</span><span class="special">&gt;</span>
  52. <span class="keyword">struct</span> <span class="identifier">actor</span>
  53. <span class="special">{</span>
  54. <span class="identifier">return_type</span>
  55. <span class="keyword">operator</span><span class="special">()()</span> <span class="keyword">const</span><span class="special">;</span>
  56. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T0</span><span class="special">&gt;</span>
  57. <span class="identifier">return_type</span>
  58. <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T0</span><span class="special">&amp;</span> <span class="identifier">_0</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  59. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T0</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">&gt;</span>
  60. <span class="identifier">return_type</span>
  61. <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T0</span><span class="special">&amp;</span> <span class="identifier">_0</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&amp;</span> <span class="identifier">_1</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  62. <span class="comment">//...
  63. </span><span class="special">};</span>
  64. </pre>
  65. <p>
  66. The actor class accepts the arguments through a set of function call operators
  67. for 0 to <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_LIMIT</span></code>
  68. arities (Don't worry about the details, for now. Note, for example, that we
  69. skimp over the details regarding <code class="computeroutput"><span class="identifier">return_type</span></code>).
  70. The arguments are passed through to the evaluation mechanism. For more information
  71. see <a class="link" href="inside/actor.html" title="Actors in Detail">Inside Actors</a>.
  72. </p>
  73. </div>
  74. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  75. <td align="left"></td>
  76. <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p>
  77. Distributed under the Boost Software License, Version 1.0. (See accompanying
  78. 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>)
  79. </p>
  80. </div></td>
  81. </tr></table>
  82. <hr>
  83. <div class="spirit-nav">
  84. <a accesskey="p" href="organization.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="modules.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  85. </div>
  86. </body>
  87. </html>