test_type_lists.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2008-2009: Joachim Faulhaber
  3. +------------------------------------------------------------------------------+
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENCE.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. +-----------------------------------------------------------------------------*/
  8. #ifndef BOOST_ICL_TEST_TYPE_LISTS_HPP_JOFA_080916
  9. #define BOOST_ICL_TEST_TYPE_LISTS_HPP_JOFA_080916
  10. //#define BOOST_ICL_TEST_XINT
  11. //#define BOOST_ICL_TEST_CHRONO
  12. #include <boost/mpl/list.hpp>
  13. // interval instance types
  14. #include <boost/icl/gregorian.hpp>
  15. #include <boost/icl/ptime.hpp>
  16. #ifdef BOOST_ICL_TEST_XINT
  17. # include <boost/icl/xint.hpp>
  18. #endif
  19. #ifdef BOOST_ICL_TEST_CHRONO
  20. # define BOOST_CHRONO_EXTENSIONS
  21. # include <libs/icl/test/chrono/utility.hpp>
  22. namespace boch = boost::chrono;
  23. #endif
  24. #include <boost/icl/rational.hpp>
  25. #if(_MSC_VER < 1500 && defined(_DEBUG) ) // 1500 = MSVC-9.0
  26. typedef int boost_posix_time_ptime;
  27. typedef int boost_posix_time_duration;
  28. typedef int boost_gregorian_date;
  29. typedef int boost_gregorian_date_duration;
  30. #else
  31. typedef boost::posix_time::ptime boost_posix_time_ptime;
  32. typedef boost::posix_time::time_duration boost_posix_time_duration;
  33. typedef boost::gregorian::date boost_gregorian_date;
  34. typedef boost::gregorian::date_duration boost_gregorian_date_duration;
  35. #endif
  36. typedef ::boost::mpl::list<
  37. unsigned short, unsigned int, unsigned long
  38. ,short, int, long, long long
  39. ,float, double, long double
  40. ,boost::rational<int>
  41. #ifdef BOOST_ICL_TEST_XINT
  42. ,boost::xint::integer
  43. ,boost::rational<boost::xint::integer>
  44. #endif
  45. #ifdef BOOST_ICL_TEST_CHRONO
  46. ,boch::duration<int>
  47. ,boch::duration<double>
  48. ,Now::time_point
  49. ,boch::time_point<Now, boch::duration<double> >
  50. #endif
  51. ,boost_posix_time_ptime
  52. ,boost_posix_time_duration
  53. ,boost_gregorian_date
  54. ,boost_gregorian_date_duration
  55. ,int*
  56. > bicremental_types;
  57. #ifdef BOOST_ICL_TEST_CHRONO
  58. typedef boch::duration<long long, boost::ratio<1,113> > duration_long2_113s;
  59. typedef boch::duration<int, boost::ratio<11,113> > duration_int_11_113s;
  60. typedef boch::duration<boost::rational<int>, boost::ratio<101,997> > duration_rational_101_997s;
  61. typedef boch::time_point<Now, duration_int_11_113s > Now_time_int_11_113s;
  62. typedef boch::time_point<Now, boch::duration<double> > Now_time_double;
  63. typedef boch::time_point<Now, boch::duration<boost::rational<int> > > Now_time_rational;
  64. typedef boch::time_point<Now, duration_rational_101_997s > Now_time_rational_101_997s;
  65. typedef boch::duration<int> bicremental_type_1;
  66. typedef boch::duration<double> bicremental_type_2;
  67. typedef Now::time_point bicremental_type_3;
  68. typedef Now_time_double bicremental_type_4;
  69. typedef Now_time_rational bicremental_type_5;
  70. typedef duration_long2_113s bicremental_type_6;
  71. typedef duration_rational_101_997s bicremental_type_7;
  72. typedef Now_time_rational_101_997s bicremental_type_8;
  73. #else
  74. typedef unsigned int bicremental_type_1;
  75. typedef int bicremental_type_2;
  76. typedef double bicremental_type_3;
  77. typedef boost::rational<int> bicremental_type_4;
  78. typedef boost_posix_time_ptime bicremental_type_5;
  79. typedef short bicremental_type_6;
  80. typedef float bicremental_type_7;
  81. typedef int* bicremental_type_8;
  82. #endif //BOOST_ICL_TEST_CHRONO
  83. typedef ::boost::mpl::list<
  84. short, int, long, long long
  85. ,float, double, long double
  86. ,boost::rational<int>
  87. #ifdef BOOST_ICL_TEST_XINT
  88. ,boost::xint::integer
  89. ,boost::rational<boost::xint::integer>
  90. #endif
  91. #ifdef BOOST_ICL_TEST_CHRONO
  92. ,boch::duration<int>
  93. ,boch::duration<float>
  94. ,Now::time_point
  95. #endif
  96. > signed_bicremental_types;
  97. #ifdef BOOST_ICL_TEST_CHRONO
  98. typedef boch::duration<int> signed_bicremental_type_1;
  99. typedef boch::duration<double> signed_bicremental_type_2;
  100. typedef Now::time_point signed_bicremental_type_3;
  101. typedef Now_time_double signed_bicremental_type_4;
  102. typedef Now_time_rational signed_bicremental_type_5;
  103. #else
  104. typedef int signed_bicremental_type_1;
  105. typedef double signed_bicremental_type_2;
  106. typedef boost::rational<int> signed_bicremental_type_3;
  107. typedef short signed_bicremental_type_4;
  108. typedef float signed_bicremental_type_5;
  109. #endif //BOOST_ICL_TEST_CHRONO
  110. //DBG short list for debugging
  111. typedef ::boost::mpl::list<
  112. int
  113. > debug_types;
  114. typedef ::boost::mpl::list<
  115. float, double, long double
  116. ,boost::rational<int>
  117. #ifdef BOOST_ICL_TEST_XINT
  118. ,boost::rational<boost::xint::integer>
  119. #endif
  120. #ifdef BOOST_ICL_TEST_CHRONO
  121. ,boch::duration<double>
  122. ,boch::time_point<Now, boch::duration<double> >
  123. #endif
  124. > bicremental_continuous_types;
  125. #ifdef BOOST_ICL_TEST_CHRONO
  126. typedef boch::duration<double> bicremental_continuous_type_1;
  127. typedef Now_time_double bicremental_continuous_type_2;
  128. typedef Now_time_rational bicremental_continuous_type_3;
  129. #else
  130. typedef float bicremental_continuous_type_1;
  131. typedef double bicremental_continuous_type_2;
  132. typedef boost::rational<int> bicremental_continuous_type_3;
  133. #endif // BOOST_ICL_TEST_CHRONO
  134. typedef ::boost::mpl::list<
  135. unsigned short, unsigned int
  136. ,unsigned long, unsigned long long
  137. ,short, int, long, long long
  138. #ifdef BOOST_ICL_TEST_XINT
  139. ,boost::xint::integer
  140. #endif
  141. > integral_types;
  142. typedef int integral_type_1;
  143. typedef unsigned int integral_type_2;
  144. typedef short integral_type_3;
  145. typedef unsigned int integral_type_4;
  146. typedef ::boost::mpl::list<
  147. unsigned short, unsigned int
  148. ,unsigned long, unsigned long long
  149. ,short, int, long
  150. #ifdef BOOST_ICL_TEST_XINT
  151. ,boost::xint::integer
  152. #endif
  153. #ifdef BOOST_ICL_TEST_CHRONO
  154. ,boch::duration<unsigned short>
  155. ,Now::time_point
  156. #endif
  157. ,boost_posix_time_ptime
  158. ,boost_posix_time_duration
  159. ,boost_gregorian_date
  160. ,boost_gregorian_date_duration
  161. ,int*
  162. > discrete_types;
  163. #ifdef BOOST_ICL_TEST_CHRONO
  164. typedef boch::duration<int> discrete_type_1;
  165. typedef duration_int_11_113s discrete_type_2;
  166. typedef Now::time_point discrete_type_3;
  167. typedef duration_long2_113s discrete_type_4;
  168. typedef Now_time_int_11_113s discrete_type_5;
  169. typedef short discrete_type_6;
  170. typedef int* discrete_type_7;
  171. typedef boost_posix_time_duration discrete_type_8;
  172. #else
  173. typedef int discrete_type_1;
  174. typedef boost_posix_time_ptime discrete_type_2;
  175. typedef unsigned int discrete_type_3;
  176. typedef short discrete_type_4;
  177. typedef int* discrete_type_5;
  178. typedef boost_posix_time_duration discrete_type_6;
  179. typedef boost_gregorian_date discrete_type_7;
  180. typedef boost_gregorian_date_duration discrete_type_8;
  181. #endif //BOOST_ICL_TEST_CHRONO
  182. typedef ::boost::mpl::list<
  183. short, int, long
  184. > signed_discrete_types;
  185. #ifdef BOOST_ICL_TEST_CHRONO
  186. typedef Now::time_point signed_discrete_type_1;
  187. typedef duration_long2_113s signed_discrete_type_2;
  188. typedef Now_time_int_11_113s signed_discrete_type_3;
  189. #else
  190. typedef int signed_discrete_type_1;
  191. typedef short signed_discrete_type_2;
  192. typedef long signed_discrete_type_3;
  193. #endif //BOOST_ICL_TEST_CHRONO
  194. typedef ::boost::mpl::list<
  195. float, double, long double
  196. ,boost::rational<int>
  197. #ifdef BOOST_ICL_TEST_XINT
  198. ,boost::rational<boost::xint::integer>
  199. #endif
  200. //JODO
  201. //test_interval_map_shared.hpp(1190) : error C2440: 'initializing' : cannot convert from 'long double' to 'boost::chrono::duration<Rep>'
  202. //#ifdef BOOST_ICL_TEST_CHRONO
  203. // ,boost::chrono::duration<long double>
  204. //#endif
  205. > numeric_continuous_types;
  206. #ifdef BOOST_ICL_TEST_CHRONO
  207. typedef boch::duration<double> numeric_continuous_type_1;
  208. typedef Now_time_double numeric_continuous_type_2;
  209. typedef Now_time_rational numeric_continuous_type_3;
  210. typedef duration_rational_101_997s numeric_continuous_type_4;
  211. #else
  212. typedef double numeric_continuous_type_1;
  213. typedef float numeric_continuous_type_2;
  214. typedef boost::rational<int> numeric_continuous_type_3;
  215. typedef long double numeric_continuous_type_4;
  216. #endif //BOOST_ICL_TEST_CHRONO
  217. typedef ::boost::mpl::list<
  218. float, double, long double
  219. ,boost::rational<int>
  220. #ifdef BOOST_ICL_TEST_XINT
  221. ,boost::rational<boost::xint::integer>
  222. #endif
  223. #ifdef BOOST_ICL_TEST_CHRONO
  224. ,boch::duration<double>
  225. ,boch::time_point<Now, boch::duration<double> >
  226. #endif
  227. ,std::string
  228. > continuous_types;
  229. #ifdef BOOST_ICL_TEST_CHRONO
  230. typedef boch::duration<double> continuous_type_1;
  231. typedef Now_time_double continuous_type_2;
  232. typedef Now_time_rational continuous_type_3;
  233. typedef std::string continuous_type_4;
  234. #else
  235. typedef double continuous_type_1;
  236. typedef float continuous_type_2;
  237. typedef boost::rational<int> continuous_type_3;
  238. typedef std::string continuous_type_4;
  239. #endif //BOOST_ICL_TEST_CHRONO
  240. typedef ::boost::mpl::list<
  241. unsigned short
  242. ,unsigned long
  243. ,unsigned long long
  244. ,short
  245. ,int
  246. ,long
  247. ,long long
  248. ,float
  249. ,double
  250. ,long double
  251. ,boost::rational<int>
  252. #ifdef BOOST_ICL_TEST_XINT
  253. ,boost::xint::integer
  254. #endif
  255. #ifdef BOOST_ICL_TEST_CHRONO
  256. ,boch::duration<short>
  257. ,boch::duration<long double>
  258. ,Now::time_point
  259. #endif
  260. ,boost_posix_time_ptime
  261. ,boost_posix_time_duration
  262. ,boost_gregorian_date
  263. ,boost_gregorian_date_duration
  264. ,int*
  265. ,std::string
  266. > ordered_types;
  267. #ifdef BOOST_ICL_TEST_CHRONO
  268. typedef boch::duration<int> ordered_type_1;
  269. typedef boch::duration<double> ordered_type_2;
  270. typedef Now::time_point ordered_type_3;
  271. typedef Now_time_double ordered_type_4;
  272. typedef Now_time_rational ordered_type_5;
  273. #else
  274. typedef int ordered_type_1;
  275. typedef std::string ordered_type_2;
  276. typedef boost_posix_time_ptime ordered_type_3;
  277. typedef boost::rational<int> ordered_type_4;
  278. typedef double ordered_type_5;
  279. #endif //BOOST_ICL_TEST_CHRONO
  280. #endif