adapt_adt.hpp 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*=============================================================================
  2. Copyright (c) 2001-2009 Joel de Guzman
  3. Copyright (c) 2009-2010 Hartmut Kaiser
  4. Copyright (c) 2010-2011 Christopher Schmidt
  5. Copyright (c) 2013-2014 Damien Buhl
  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. #ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
  10. #define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
  11. #include <boost/fusion/support/config.hpp>
  12. #include <boost/preprocessor/cat.hpp>
  13. #include <boost/preprocessor/empty.hpp>
  14. #include <boost/preprocessor/control/if.hpp>
  15. #include <boost/preprocessor/comparison/less.hpp>
  16. #include <boost/fusion/adapted/struct/detail/extension.hpp>
  17. #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
  18. #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
  19. #include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
  20. #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
  21. #include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
  22. #include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
  23. #include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
  24. #include <boost/fusion/adapted/struct/detail/size_impl.hpp>
  25. #include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
  26. #include <boost/fusion/adapted/struct/detail/end_impl.hpp>
  27. #include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
  28. #include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
  29. #include <boost/fusion/adapted/adt/detail/extension.hpp>
  30. #include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
  31. #include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
  32. #define BOOST_FUSION_ADAPT_ADT_C( \
  33. TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
  34. BOOST_FUSION_ADAPT_ADT_C_BASE( \
  35. TEMPLATE_PARAMS_SEQ, \
  36. NAME_SEQ, \
  37. I, \
  38. BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
  39. BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
  40. BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
  41. BOOST_PP_LESS( \
  42. BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4)) \
  43. #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \
  44. BOOST_FUSION_ADAPT_STRUCT_BASE( \
  45. (1)TEMPLATE_PARAMS_SEQ, \
  46. (1)NAME_SEQ, \
  47. struct_tag, \
  48. 0, \
  49. BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
  50. BOOST_FUSION_ADAPT_ADT_C)
  51. #define BOOST_FUSION_ADAPT_ADT(NAME, ATTRIBUTES) \
  52. BOOST_FUSION_ADAPT_STRUCT_BASE( \
  53. (0), \
  54. (0)(NAME), \
  55. struct_tag, \
  56. 0, \
  57. BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
  58. BOOST_FUSION_ADAPT_ADT_C)
  59. #define BOOST_FUSION_ADAPT_ADT_AS_VIEW(NAME, ATTRIBUTES) \
  60. BOOST_FUSION_ADAPT_STRUCT_BASE( \
  61. (0), \
  62. (0)(NAME), \
  63. struct_tag, \
  64. 1, \
  65. BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
  66. BOOST_FUSION_ADAPT_ADT_C)
  67. #endif