actors.qbk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. [/==============================================================================
  2. Copyright (C) 2001-2010 Joel de Guzman
  3. Copyright (C) 2001-2005 Dan Marsden
  4. Copyright (C) 2001-2010 Thomas Heller
  5. Distributed under the Boost 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. [section Actor]
  9. The `Actor` is the main concept behind the library. Actors are function objects.
  10. An actor can accept 0 to `BOOST_PHOENIX_LIMIT` arguments.
  11. [note You can set `BOOST_PHOENIX_LIMIT`, the predefined maximum arity an
  12. actor can take. By default, `BOOST_PHOENIX_LIMIT` is set to 10.]
  13. Phoenix supplies an `actor` class template whose specializations
  14. model the `Actor` concept. `actor` has one template parameter, `Expr`,
  15. that supplies the underlying expression to evaluate.
  16. template <typename Expr>
  17. struct actor
  18. {
  19. return_type
  20. operator()() const;
  21. template <typename T0>
  22. return_type
  23. operator()(T0& _0) const;
  24. template <typename T0, typename T1>
  25. return_type
  26. operator()(T0& _0, T1& _1) const;
  27. //...
  28. };
  29. The actor class accepts the arguments through a set of function call operators
  30. for 0 to `BOOST_PHOENIX_LIMIT` arities (Don't worry about the details, for now. Note, for example,
  31. that we skimp over the details regarding `return_type`). The arguments are passed through to
  32. the evaluation mechanism. For more information see [link phoenix.inside.actor Inside Actors].
  33. [endsect]