3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../index.html" title="Chapter 1. Phoenix 3.0.5">
8 <link rel="up" href="../index.html" title="Chapter 1. Phoenix 3.0.5">
9 <link rel="prev" href="organization.html" title="Organization">
10 <link rel="next" href="modules.html" title="Modules">
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>
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>
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>
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.
34 <div class="note"><table border="0" summary="Note">
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>
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.
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.
51 <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Expr</span><span class="special">></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>
57 <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T0</span><span class="special">></span>
58 <span class="identifier">return_type</span>
59 <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T0</span><span class="special">&</span> <span class="identifier">_0</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
61 <span class="keyword">template</span> <span class="special"><</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">></span>
62 <span class="identifier">return_type</span>
63 <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T0</span><span class="special">&</span> <span class="identifier">_0</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&</span> <span class="identifier">_1</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
65 <span class="comment">//...</span>
66 <span class="special">};</span>
69 The actor class accepts the arguments through a set of function call operators
70 for 0 to <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_LIMIT</span></code>
71 arities (Don't worry about the details, for now. Note, for example, that we
72 skimp over the details regarding <code class="computeroutput"><span class="identifier">return_type</span></code>).
73 The arguments are passed through to the evaluation mechanism. For more information
74 see <a class="link" href="inside/actor.html" title="Actors in Detail">Inside Actors</a>.
77 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
78 <td align="left"></td>
79 <td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010, 2014 Joel de Guzman, Dan Marsden, Thomas Heller, John
81 Distributed under the Boost Software License, Version 1.0. (See accompanying
82 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>)
87 <div class="spirit-nav">
88 <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>