Chris@16
|
1 /*-----------------------------------------------------------------------------+
|
Chris@16
|
2 Author: Joachim Faulhaber
|
Chris@16
|
3 Copyright (c) 2009-2010: Joachim Faulhaber
|
Chris@16
|
4 +------------------------------------------------------------------------------+
|
Chris@16
|
5 Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 (See accompanying file LICENCE.txt or copy at
|
Chris@16
|
7 http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 +-----------------------------------------------------------------------------*/
|
Chris@16
|
9 /*-----------------------------------------------------------------------------+
|
Chris@16
|
10 Template parameters of major itl class templates can be designed as
|
Chris@16
|
11 template template parameters or
|
Chris@16
|
12 template type parameter
|
Chris@16
|
13 by setting defines in this file.
|
Chris@16
|
14 +-----------------------------------------------------------------------------*/
|
Chris@16
|
15 #ifndef BOOST_ICL_DESIGN_CONFIG_HPP_JOFA_090214
|
Chris@16
|
16 #define BOOST_ICL_DESIGN_CONFIG_HPP_JOFA_090214
|
Chris@16
|
17
|
Chris@16
|
18 // If this macro is defined, right_open_interval with static interval borders
|
Chris@16
|
19 // will be used as default for all interval containers.
|
Chris@16
|
20 // BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS should be defined in the application
|
Chris@16
|
21 // before other includes from the ITL
|
Chris@16
|
22 //#define BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS
|
Chris@16
|
23 // If BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS is NOT defined, ITL uses intervals
|
Chris@16
|
24 // with dynamic borders as default.
|
Chris@16
|
25
|
Chris@16
|
26
|
Chris@16
|
27 //------------------------------------------------------------------------------
|
Chris@16
|
28 // Auxiliary macros for denoting template signatures.
|
Chris@16
|
29 // Purpose:
|
Chris@16
|
30 // (1) Shorten the lenthy and redundant template signatures.
|
Chris@16
|
31 // (2) Name anonymous template types according to their meaning ...
|
Chris@16
|
32 // (3) Making easier to refactor by redefinitin of the macros
|
Chris@16
|
33 // (4) Being able to check template template parameter variants against
|
Chris@16
|
34 // template type parameter variants.
|
Chris@16
|
35
|
Chris@16
|
36 #define ICL_USE_COMPARE_TEMPLATE_TEMPLATE
|
Chris@16
|
37 #define ICL_USE_COMBINE_TEMPLATE_TEMPLATE
|
Chris@16
|
38 #define ICL_USE_SECTION_TEMPLATE_TEMPLATE
|
Chris@16
|
39 // ICL_USE_INTERVAL_TEMPLATE_TYPE
|
Chris@16
|
40
|
Chris@16
|
41 //------------------------------------------------------------------------------
|
Chris@16
|
42 // template parameter Compare can not be a template type parameter as long as
|
Chris@16
|
43 // Compare<Interval<DomainT,Compare> >() is called in std::lexicographical_compare
|
Chris@16
|
44 // implementing operator< for interval_base_{set,map}. see NOTE DESIGN TTP
|
Chris@16
|
45 #ifdef ICL_USE_COMPARE_TEMPLATE_TEMPLATE
|
Chris@16
|
46 # define ICL_COMPARE template<class>class
|
Chris@16
|
47 # define ICL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare<domain_type>
|
Chris@16
|
48 # define ICL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance
|
Chris@16
|
49 # define ICL_EXCLUSIVE_LESS(interval_type) exclusive_less_than
|
Chris@16
|
50 #else//ICL_USE_COMPARE_TEMPLATE_TYPE
|
Chris@16
|
51 # define ICL_COMPARE class
|
Chris@16
|
52 # define ICL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare
|
Chris@16
|
53 # define ICL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance<domain_type>
|
Chris@16
|
54 # define ICL_EXCLUSIVE_LESS(interval_type) exclusive_less_than<interval_type>
|
Chris@16
|
55 #endif
|
Chris@16
|
56
|
Chris@16
|
57 //------------------------------------------------------------------------------
|
Chris@16
|
58 // template parameter Combine could be a template type parameter.
|
Chris@16
|
59 #ifdef ICL_USE_COMBINE_TEMPLATE_TEMPLATE
|
Chris@16
|
60 # define ICL_COMBINE template<class>class
|
Chris@16
|
61 # define ICL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine<codomain_type>
|
Chris@16
|
62 # define ICL_COMBINE_INSTANCE(combine_instance,codomain_type) combine_instance
|
Chris@16
|
63 #else//ICL_USE_COMBINE_TEMPLATE_TYPE
|
Chris@16
|
64 # define ICL_COMBINE class
|
Chris@16
|
65 # define ICL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine
|
Chris@16
|
66 # define ICL_COMBINE_INSTANCE(combine_instance,codomain_type) combine_instance<codomain_type>
|
Chris@16
|
67 #endif
|
Chris@16
|
68
|
Chris@16
|
69 //------------------------------------------------------------------------------
|
Chris@16
|
70 // template parameter Section could be a template type parameter.
|
Chris@16
|
71 #ifdef ICL_USE_SECTION_TEMPLATE_TEMPLATE
|
Chris@16
|
72 # define ICL_SECTION template<class>class
|
Chris@16
|
73 # define ICL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect<codomain_type>
|
Chris@16
|
74 # define ICL_SECTION_INSTANCE(section_instance,codomain_type) section_instance
|
Chris@16
|
75 #else//ICL_USE_SECTION_TEMPLATE_TYPE
|
Chris@16
|
76 # define ICL_SECTION class
|
Chris@16
|
77 # define ICL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect
|
Chris@16
|
78 # define ICL_SECTION_INSTANCE(section_instance,codomain_type) section_instance<codomain_type>
|
Chris@16
|
79 #endif
|
Chris@16
|
80
|
Chris@16
|
81
|
Chris@16
|
82 //------------------------------------------------------------------------------
|
Chris@16
|
83 // template parameter Interval could be a template type parameter.
|
Chris@16
|
84 #ifdef ICL_USE_INTERVAL_TEMPLATE_TEMPLATE
|
Chris@16
|
85 # define ICL_INTERVAL(itl_compare) template<class,itl_compare>class
|
Chris@16
|
86 # define ICL_INTERVAL2(itl_compare) template<class DomT2,itl_compare>class
|
Chris@16
|
87 # define ICL_INTERVAL_TYPE(itl_interval, domain_type, itl_compare) itl_interval<domain_type,itl_compare>
|
Chris@16
|
88 # define ICL_INTERVAL_INSTANCE(interval_instance,domain_type,itl_compare) interval_instance
|
Chris@16
|
89 #else//ICL_USE_INTERVAL_TEMPLATE_TYPE
|
Chris@16
|
90 # define ICL_INTERVAL(itl_compare) class
|
Chris@16
|
91 # define ICL_INTERVAL2(itl_compare) class
|
Chris@16
|
92 # define ICL_INTERVAL_TYPE(itl_interval, domain_type, itl_compare) itl_interval
|
Chris@16
|
93 # define ICL_INTERVAL_INSTANCE(interval_instance,domain_type,itl_compare) typename interval_instance<domain_type,itl_compare>::type
|
Chris@16
|
94 #endif
|
Chris@16
|
95
|
Chris@16
|
96
|
Chris@16
|
97 //------------------------------------------------------------------------------
|
Chris@16
|
98 #define ICL_ALLOC template<class>class
|
Chris@16
|
99
|
Chris@16
|
100 //------------------------------------------------------------------------------
|
Chris@16
|
101 #define ICL_INTERVAL_DEFAULT boost::icl::interval_type_default
|
Chris@16
|
102
|
Chris@16
|
103 #ifndef BOOST_ICL_USE_COMPARE_STD_GREATER
|
Chris@16
|
104 # define ICL_COMPARE_DEFAULT std::less
|
Chris@16
|
105 #else
|
Chris@16
|
106 # define ICL_COMPARE_DEFAULT std::greater
|
Chris@16
|
107 #endif
|
Chris@16
|
108
|
Chris@16
|
109 //------------------------------------------------------------------------------
|
Chris@16
|
110
|
Chris@16
|
111 #endif // BOOST_ICL_DESIGN_CONFIG_HPP_JOFA_090214
|
Chris@16
|
112
|
Chris@16
|
113
|