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