Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP Chris@16: #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP Chris@16: Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { namespace geometry Chris@16: { Chris@16: Chris@16: Chris@16: #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@16: namespace traits Chris@16: { Chris@16: Chris@16: Chris@16: template Chris@16: struct tag > Chris@16: { Chris@16: typedef point_tag type; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct coordinate_type > Chris@16: { Chris@16: typedef T1 type; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct dimension > Chris@16: : boost::mpl::int_ Chris@16: < Chris@16: boost::tuples::length Chris@16: < Chris@16: boost::tuple Chris@16: >::value Chris@16: > Chris@16: {}; Chris@16: Chris@16: Chris@16: template Chris@16: struct access Chris@16: < Chris@16: boost::tuple, Chris@16: Dimension Chris@16: > Chris@16: { Chris@16: static inline T1 get( Chris@16: boost::tuple const& point) Chris@16: { Chris@16: return point.template get(); Chris@16: } Chris@16: Chris@16: static inline void set( Chris@16: boost::tuple& point, Chris@16: T1 const& value) Chris@16: { Chris@16: point.template get() = value; Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: } // namespace traits Chris@16: #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@16: Chris@16: Chris@16: }} // namespace boost::geometry Chris@16: Chris@16: Chris@16: // Convenience registration macro to bind boost::tuple to a CS Chris@16: #define BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(CoordinateSystem) \ Chris@16: namespace boost { namespace geometry { namespace traits { \ Chris@16: template \ Chris@16: struct coordinate_system > \ Chris@16: { \ Chris@16: typedef CoordinateSystem type; \ Chris@16: }; \ Chris@16: }}} Chris@16: Chris@16: Chris@16: #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP