]>
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 | return_type | |
29 | operator()(); | |
30 | ||
31 | template <typename T0> | |
32 | return_type | |
33 | operator()(T0& _0) const; | |
34 | ||
35 | template <typename T0> | |
36 | return_type | |
37 | operator()(T0 const& _0) const; | |
38 | ||
39 | template <typename T0> | |
40 | return_type | |
41 | operator()(T0& _0); | |
42 | ||
43 | template <typename T0> | |
44 | return_type | |
45 | operator()(T0 const& _0); | |
46 | ||
47 | ||
48 | //... | |
49 | }; | |
50 | ||
51 | The actor class accepts the arguments through a set of function call operators | |
52 | for 0 to `BOOST_PHOENIX_LIMIT` arities (Don't worry about the details, for now. Note, for example, | |
53 | that we skimed over the details regarding `return_type`). The arguments | |
54 | are then forwarded to the actor's `Expr` for evaluation. | |
55 | ||
56 | [endsect] | |
57 |