data_equal.hpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_HPP)
  6. #define BOOST_VMD_DETAIL_DATA_EQUAL_HPP
  7. #include <boost/vmd/detail/recurse/data_equal/data_equal_1.hpp>
  8. #include <boost/vmd/detail/recurse/data_equal/data_equal_2.hpp>
  9. #include <boost/vmd/detail/recurse/data_equal/data_equal_3.hpp>
  10. #include <boost/vmd/detail/recurse/data_equal/data_equal_4.hpp>
  11. #include <boost/vmd/detail/recurse/data_equal/data_equal_5.hpp>
  12. #include <boost/vmd/detail/recurse/data_equal/data_equal_6.hpp>
  13. #include <boost/vmd/detail/recurse/data_equal/data_equal_7.hpp>
  14. #include <boost/vmd/detail/recurse/data_equal/data_equal_8.hpp>
  15. #include <boost/vmd/detail/recurse/data_equal/data_equal_9.hpp>
  16. #include <boost/vmd/detail/recurse/data_equal/data_equal_10.hpp>
  17. #include <boost/vmd/detail/recurse/data_equal/data_equal_11.hpp>
  18. #include <boost/vmd/detail/recurse/data_equal/data_equal_12.hpp>
  19. #include <boost/vmd/detail/recurse/data_equal/data_equal_13.hpp>
  20. #include <boost/vmd/detail/recurse/data_equal/data_equal_14.hpp>
  21. #include <boost/vmd/detail/recurse/data_equal/data_equal_15.hpp>
  22. #include <boost/vmd/detail/recurse/data_equal/data_equal_16.hpp>
  23. #include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp>
  24. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS(d,em1,em2) \
  25. BOOST_VMD_IDENTITY_RESULT \
  26. ( \
  27. BOOST_PP_IIF \
  28. ( \
  29. BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \
  30. BOOST_VMD_IDENTITY(2), \
  31. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \
  32. ) \
  33. (d,em1,em2) \
  34. ) \
  35. /**/
  36. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS_D(d,em1,em2) \
  37. BOOST_VMD_IDENTITY_RESULT \
  38. ( \
  39. BOOST_PP_IIF \
  40. ( \
  41. BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \
  42. BOOST_VMD_IDENTITY(2), \
  43. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \
  44. ) \
  45. (d,em1,em2) \
  46. ) \
  47. /**/
  48. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP(d,state,em1,em2) \
  49. BOOST_PP_IIF \
  50. ( \
  51. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \
  52. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \
  53. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS \
  54. ) \
  55. (d,em1,em2) \
  56. /**/
  57. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_D(d,state,em1,em2) \
  58. BOOST_PP_IIF \
  59. ( \
  60. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \
  61. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \
  62. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS_D \
  63. ) \
  64. (d,em1,em2) \
  65. /**/
  66. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ(d,state) \
  67. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP \
  68. ( \
  69. d, \
  70. state, \
  71. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \
  72. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \
  73. ) \
  74. /**/
  75. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_D(d,state) \
  76. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_D \
  77. ( \
  78. d, \
  79. state, \
  80. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \
  81. BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \
  82. ) \
  83. /**/
  84. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP(d,state) \
  85. BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \
  86. ( \
  87. d, \
  88. state, \
  89. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ(d,state) \
  90. ) \
  91. /**/
  92. #define BOOST_VMD_DETAIL_DATA_EQUAL_OP_D(d,state) \
  93. BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \
  94. ( \
  95. d, \
  96. state, \
  97. BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_D(d,state) \
  98. ) \
  99. /**/
  100. #define BOOST_VMD_DETAIL_DATA_EQUAL_LOOP(dataf,datas,sz,vtype) \
  101. BOOST_PP_TUPLE_ELEM \
  102. ( \
  103. 0, \
  104. BOOST_PP_WHILE \
  105. ( \
  106. BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \
  107. BOOST_VMD_DETAIL_DATA_EQUAL_OP, \
  108. ( \
  109. 1, \
  110. dataf, \
  111. datas, \
  112. sz, \
  113. vtype, \
  114. 0, \
  115. ) \
  116. ) \
  117. ) \
  118. /**/
  119. #define BOOST_VMD_DETAIL_DATA_EQUAL_LOOP_D(d,dataf,datas,sz,vtype) \
  120. BOOST_PP_TUPLE_ELEM \
  121. ( \
  122. 0, \
  123. BOOST_PP_WHILE_ ## d \
  124. ( \
  125. BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \
  126. BOOST_VMD_DETAIL_DATA_EQUAL_OP_D, \
  127. ( \
  128. 1, \
  129. dataf, \
  130. datas, \
  131. sz, \
  132. vtype, \
  133. 0, \
  134. ) \
  135. ) \
  136. ) \
  137. /**/
  138. #define BOOST_VMD_DETAIL_DATA_EQUAL_SZ(dataf,datas,szf,szs,vtype) \
  139. BOOST_VMD_IDENTITY_RESULT \
  140. ( \
  141. BOOST_PP_IIF \
  142. ( \
  143. BOOST_PP_EQUAL(szf,szs), \
  144. BOOST_VMD_DETAIL_DATA_EQUAL_LOOP, \
  145. BOOST_VMD_IDENTITY(0) \
  146. ) \
  147. (dataf,datas,szf,vtype) \
  148. ) \
  149. /**/
  150. #define BOOST_VMD_DETAIL_DATA_EQUAL_SZ_D(d,dataf,datas,szf,szs,vtype) \
  151. BOOST_VMD_IDENTITY_RESULT \
  152. ( \
  153. BOOST_PP_IIF \
  154. ( \
  155. BOOST_PP_EQUAL_D(d,szf,szs), \
  156. BOOST_VMD_DETAIL_DATA_EQUAL_LOOP_D, \
  157. BOOST_VMD_IDENTITY(0) \
  158. ) \
  159. (d,dataf,datas,szf,vtype) \
  160. ) \
  161. /**/
  162. #define BOOST_VMD_DETAIL_DATA_EQUAL(dataf,datas,vtype) \
  163. BOOST_VMD_DETAIL_DATA_EQUAL_SZ \
  164. ( \
  165. dataf, \
  166. datas, \
  167. BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \
  168. BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \
  169. vtype \
  170. ) \
  171. /**/
  172. #define BOOST_VMD_DETAIL_DATA_EQUAL_D(d,dataf,datas,vtype) \
  173. BOOST_VMD_DETAIL_DATA_EQUAL_SZ_D \
  174. ( \
  175. d, \
  176. dataf, \
  177. datas, \
  178. BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \
  179. BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \
  180. vtype \
  181. ) \
  182. /**/
  183. #endif /* BOOST_VMD_DETAIL_DATA_EQUAL_HPP */