Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:27

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0004 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2018-2020.
0008 // Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
0009 
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 
0012 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0013 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0014 
0015 // Use, modification and distribution is subject to the Boost Software License,
0016 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0017 // http://www.boost.org/LICENSE_1_0.txt)
0018 
0019 #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP
0020 #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP
0021 
0022 
0023 #include <cstddef>
0024 #include <type_traits>
0025 
0026 #include <boost/tuple/tuple.hpp>
0027 
0028 #include <boost/geometry/core/access.hpp>
0029 #include <boost/geometry/core/coordinate_dimension.hpp>
0030 #include <boost/geometry/core/coordinate_type.hpp>
0031 #include <boost/geometry/core/point_type.hpp>
0032 #include <boost/geometry/core/tags.hpp>
0033 
0034 
0035 namespace boost { namespace geometry
0036 {
0037 
0038 
0039 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0040 namespace traits
0041 {
0042 
0043 
0044 template <typename T1, typename T2, typename T3, typename T4, typename T5,
0045           typename T6, typename T7, typename T8, typename T9, typename T10>
0046 struct tag<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
0047 {
0048     typedef point_tag type;
0049 };
0050 
0051 
0052 template <typename T1, typename T2, typename T3, typename T4, typename T5,
0053           typename T6, typename T7, typename T8, typename T9, typename T10>
0054 struct coordinate_type<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
0055 {
0056     typedef T1 type;
0057 };
0058 
0059 
0060 template <typename T1, typename T2, typename T3, typename T4, typename T5,
0061           typename T6, typename T7, typename T8, typename T9, typename T10>
0062 struct dimension<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
0063     : std::integral_constant
0064         <
0065             std::size_t,
0066             boost::tuples::length
0067                 <
0068                     boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
0069                 >::value
0070         >
0071 {};
0072 
0073 
0074 template <typename T1, typename T2, typename T3, typename T4, typename T5,
0075           typename T6, typename T7, typename T8, typename T9, typename T10,
0076           std::size_t Dimension>
0077 struct access
0078     <
0079         boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>,
0080         Dimension
0081     >
0082 {
0083     static inline T1 get(
0084         boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> const& point)
0085     {
0086         return point.template get<Dimension>();
0087     }
0088 
0089     static inline void set(
0090         boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& point,
0091         T1 const& value)
0092     {
0093         point.template get<Dimension>() = value;
0094     }
0095 };
0096 
0097 
0098 } // namespace traits
0099 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0100 
0101 
0102 }} // namespace boost::geometry
0103 
0104 
0105 // Convenience registration macro to bind boost::tuple to a CS
0106 #define BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(CoordinateSystem) \
0107     namespace boost { namespace geometry { namespace traits { \
0108     template <typename T1, typename T2, typename T3, typename T4, typename T5, \
0109               typename T6, typename T7, typename T8, typename T9, typename T10> \
0110     struct coordinate_system<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> > \
0111     { \
0112         typedef CoordinateSystem type; \
0113     }; \
0114     }}}
0115 
0116 
0117 #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP