File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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 }
0099 #endif
0100
0101
0102 }}
0103
0104
0105
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