/Src/Dependencies/Boost/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp

http://hadesmem.googlecode.com/ · C++ Header · 69 lines · 49 code · 13 blank · 7 comment · 0 complexity · 80942bde288f57262176bd310dfd6e17 MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2005-2007 Dan Marsden
  3. Copyright (c) 2005-2007 Joel de Guzman
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #ifndef BOOST_PP_IS_ITERATING
  8. #ifndef PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_GEN_HPP
  9. #define PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_GEN_HPP
  10. #include <boost/spirit/home/phoenix/core/composite.hpp>
  11. #include <boost/spirit/home/phoenix/core/compose.hpp>
  12. #include <boost/spirit/home/phoenix/core/as_actor.hpp>
  13. #include <boost/spirit/home/phoenix/core/limits.hpp>
  14. #include <boost/spirit/home/phoenix/core/actor.hpp>
  15. #include <boost/preprocessor/repetition/enum_params.hpp>
  16. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  17. #include <boost/preprocessor/iteration/iterate.hpp>
  18. #include <boost/preprocessor/arithmetic/dec.hpp>
  19. #include <boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp>
  20. namespace boost { namespace phoenix {
  21. template<typename Actor, typename MemFunPtr>
  22. struct mem_fun_ptr_gen
  23. {
  24. mem_fun_ptr_gen(
  25. const Actor& actor, MemFunPtr memFunPtr)
  26. : mActor(actor), mMemFunPtr(memFunPtr) { }
  27. actor<typename as_composite<mem_fun_ptr_eval, Actor, typename as_actor<MemFunPtr>::type>::type>
  28. operator()() const
  29. {
  30. return compose<mem_fun_ptr_eval>(
  31. mActor, as_actor<MemFunPtr>::convert(mMemFunPtr));
  32. }
  33. #define BOOST_PP_ITERATION_PARAMS_1 \
  34. (3, (1, BOOST_PP_DEC(BOOST_PP_DEC(PHOENIX_MEMBER_LIMIT)), "boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp"))
  35. #include BOOST_PP_ITERATE()
  36. Actor mActor;
  37. MemFunPtr mMemFunPtr;
  38. };
  39. }}
  40. #endif
  41. #else
  42. #define PHOENIX_ITERATION BOOST_PP_ITERATION()
  43. template<BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename Arg)>
  44. actor<typename as_composite<
  45. mem_fun_ptr_eval, Actor, typename as_actor<MemFunPtr>::type,
  46. BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, Arg)>::type>
  47. operator()(
  48. BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, const Arg, &arg)) const
  49. {
  50. return compose<mem_fun_ptr_eval>(
  51. mActor, as_actor<MemFunPtr>::convert(mMemFunPtr),
  52. BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, arg));
  53. }
  54. #undef PHOENIX_ITERATION
  55. #endif