1 /*
2   Copyright 2008 Intel Corporation
3 
4   Use, modification and distribution are subject to the Boost Software License,
5   Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6   http://www.boost.org/LICENSE_1_0.txt).
7 */
8 #ifndef BOOST_POLYGON_INTERVAL_TRAITS_HPP
9 #define BOOST_POLYGON_INTERVAL_TRAITS_HPP
10 namespace boost { namespace polygon{
11   template <typename T>
12   struct interval_traits {
13     typedef typename T::coordinate_type coordinate_type;
14 
getboost::polygon::interval_traits15     static inline coordinate_type get(const T& interval, direction_1d dir) {
16       return interval.get(dir);
17     }
18   };
19 
20   template <typename T>
21   struct interval_mutable_traits {
setboost::polygon::interval_mutable_traits22     static inline void set(T& interval, direction_1d dir, typename interval_traits<T>::coordinate_type value) {
23       interval.set(dir, value);
24     }
constructboost::polygon::interval_mutable_traits25     static inline T construct(typename interval_traits<T>::coordinate_type low_value,
26                               typename interval_traits<T>::coordinate_type high_value) {
27       return T(low_value, high_value);
28     }
29   };
30 }
31 }
32 #endif
33 
34