]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/============================================================================== |
2 | Copyright (C) 2001-2010 Joel de Guzman | |
3 | Copyright (C) 2001-2005 Dan Marsden | |
4 | Copyright (C) 2001-2010 Thomas Heller | |
5 | ||
6 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | ===============================================================================/] | |
9 | ||
10 | [section Actor] | |
11 | ||
12 | The `Actor` is the main concept behind the library. Actors are function objects. | |
13 | An actor can accept 0 to `BOOST_PHOENIX_LIMIT` arguments. | |
14 | ||
15 | [note You can set `BOOST_PHOENIX_LIMIT`, the predefined maximum arity an | |
16 | actor can take. By default, `BOOST_PHOENIX_LIMIT` is set to 10.] | |
17 | ||
18 | Phoenix supplies an `actor` class template whose specializations | |
19 | model the `Actor` concept. `actor` has one template parameter, `Expr`, | |
20 | that supplies the underlying expression to evaluate. | |
21 | ||
22 | template <typename Expr> | |
23 | struct actor | |
24 | { | |
25 | return_type | |
26 | operator()() const; | |
27 | ||
28 | template <typename T0> | |
29 | return_type | |
30 | operator()(T0& _0) const; | |
31 | ||
32 | template <typename T0, typename T1> | |
33 | return_type | |
34 | operator()(T0& _0, T1& _1) const; | |
35 | ||
36 | //... | |
37 | }; | |
38 | ||
39 | The actor class accepts the arguments through a set of function call operators | |
40 | for 0 to `BOOST_PHOENIX_LIMIT` arities (Don't worry about the details, for now. Note, for example, | |
41 | that we skimp over the details regarding `return_type`). The arguments are passed through to | |
42 | the evaluation mechanism. For more information see [link phoenix.inside.actor Inside Actors]. | |
43 | ||
44 | [endsect] | |
45 |