Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2020.
0008 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 
0011 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0012 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0013 
0014 // Use, modification and distribution is subject to the Boost Software License,
0015 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
0017 
0018 
0019 #ifndef BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
0020 #define BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
0021 
0022 
0023 #include <type_traits>
0024 
0025 #include <boost/geometry/core/static_assert.hpp>
0026 #include <boost/geometry/core/tag.hpp>
0027 #include <boost/geometry/core/tags.hpp>
0028 
0029 
0030 namespace boost { namespace geometry
0031 {
0032 
0033 
0034 #ifndef DOXYGEN_NO_DISPATCH
0035 namespace core_dispatch
0036 {
0037 
0038 template <typename GeometryTag>
0039 struct geometry_id
0040 {
0041     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0042         "Not implemented for this Geometry type.",
0043         GeometryTag);
0044 };
0045 
0046 
0047 template <>
0048 struct geometry_id<point_tag>               : std::integral_constant<int, 1> {};
0049 
0050 
0051 template <>
0052 struct geometry_id<linestring_tag>          : std::integral_constant<int, 2> {};
0053 
0054 
0055 template <>
0056 struct geometry_id<polygon_tag>             : std::integral_constant<int, 3> {};
0057 
0058 
0059 template <>
0060 struct geometry_id<multi_point_tag>         : std::integral_constant<int, 4> {};
0061 
0062 
0063 template <>
0064 struct geometry_id<multi_linestring_tag>    : std::integral_constant<int, 5> {};
0065 
0066 
0067 template <>
0068 struct geometry_id<multi_polygon_tag>       : std::integral_constant<int, 6> {};
0069 
0070 
0071 template <>
0072 struct geometry_id<geometry_collection_tag> : std::integral_constant<int, 7> {};
0073 
0074 
0075 template <>
0076 struct geometry_id<segment_tag>             : std::integral_constant<int, 92> {};
0077 
0078 
0079 template <>
0080 struct geometry_id<ring_tag>                : std::integral_constant<int, 93> {};
0081 
0082 
0083 template <>
0084 struct geometry_id<box_tag>                 : std::integral_constant<int, 94> {};
0085 
0086 
0087 } // namespace core_dispatch
0088 #endif
0089 
0090 
0091 
0092 /*!
0093 \brief Meta-function returning the id of a geometry type
0094 \details The meta-function geometry_id defines a numerical ID (based on
0095     std::integral_constant<int, ...> ) for each geometry concept. A numerical ID is
0096     sometimes useful, and within Boost.Geometry it is used for the
0097     reverse_dispatch metafuntion.
0098 \note Used for e.g. reverse meta-function
0099 \ingroup core
0100 */
0101 template <typename Geometry>
0102 struct geometry_id : core_dispatch::geometry_id<typename tag<Geometry>::type>
0103 {};
0104 
0105 
0106 }} // namespace boost::geometry
0107 
0108 
0109 #endif // BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP