dynamic.hpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  2. #ifndef BOOST_PHOENIX_SCOPE_DETAIL_DYNAMIC_HPP
  3. #define BOOST_PHOENIX_SCOPE_DETAIL_DYNAMIC_HPP
  4. #include <boost/phoenix/support/iterate.hpp>
  5. #include <boost/phoenix/scope/detail/cpp03/preprocessed/dynamic.hpp>
  6. #endif
  7. #else
  8. #if !BOOST_PHOENIX_IS_ITERATING
  9. #ifndef BOOST_PHOENIX_SCOPE_DETAIL_DYNAMIC_HPP
  10. #define BOOST_PHOENIX_SCOPE_DETAIL_DYNAMIC_HPP
  11. #include <boost/phoenix/support/iterate.hpp>
  12. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  13. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/dynamic_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  14. #endif
  15. /*==============================================================================
  16. Copyright (c) 2005-2010 Joel de Guzman
  17. Copyright (c) 2010 Thomas Heller
  18. Distributed under the Boost Software License, Version 1.0. (See accompanying
  19. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  20. ==============================================================================*/
  21. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  22. #pragma wave option(preserve: 1)
  23. #endif
  24. #define BOOST_PHOENIX_SCOPE_DYNAMIC_MEMBER(_, N, __) \
  25. typedef \
  26. typename expression::dynamic_member< \
  27. mpl::int_<N> \
  28. , self_type * \
  29. >::type const \
  30. BOOST_PP_CAT(member, BOOST_PP_INC(N)); \
  31. /**/
  32. #define BOOST_PHOENIX_ITERATION_PARAMS \
  33. (3, (1, BOOST_PHOENIX_DYNAMIC_LIMIT, \
  34. <boost/phoenix/scope/detail/cpp03/dynamic.hpp>))
  35. #include BOOST_PHOENIX_ITERATE()
  36. #undef BOOST_PHOENIX_SCOPE_DYNAMIC_MEMBER
  37. #endif
  38. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  39. #pragma wave option(output: null)
  40. #endif
  41. #else
  42. template <BOOST_PHOENIX_typename_A>
  43. struct dynamic<BOOST_PHOENIX_A> : noncopyable
  44. {
  45. typedef
  46. BOOST_PP_CAT(vector, BOOST_PHOENIX_ITERATION)<BOOST_PHOENIX_A>
  47. tuple_type;
  48. typedef
  49. dynamic<BOOST_PHOENIX_A>
  50. self_type;
  51. typedef
  52. dynamic_frame<self_type>
  53. dynamic_frame_type;
  54. dynamic()
  55. : frame(0) {}
  56. template <int N>
  57. static
  58. typename expression::dynamic_member<mpl::int_<N>, self_type *>::type const
  59. init(self_type * scope)
  60. {
  61. return
  62. expression::
  63. dynamic_member<mpl::int_<N>, self_type *>::
  64. make(mpl::int_<N>(), scope);
  65. }
  66. BOOST_PP_REPEAT(
  67. BOOST_PHOENIX_ITERATION
  68. , BOOST_PHOENIX_SCOPE_DYNAMIC_MEMBER
  69. , _
  70. )
  71. mutable dynamic_frame_type* frame;
  72. };
  73. #endif
  74. #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES