Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:43:05

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 // Copyright (c) 2024 Adam Wulkiewicz, Lodz, Poland.
0007 
0008 // This file was modified by Oracle on 2020.
0009 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
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 
0020 #ifndef BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
0021 #define BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
0022 
0023 
0024 #include <type_traits>
0025 
0026 #include <boost/geometry/core/static_assert.hpp>
0027 #include <boost/geometry/core/tag.hpp>
0028 #include <boost/geometry/core/tags.hpp>
0029 
0030 
0031 namespace boost { namespace geometry
0032 {
0033 
0034 
0035 #ifndef DOXYGEN_NO_DISPATCH
0036 namespace core_dispatch
0037 {
0038 
0039 template <typename GeometryTag>
0040 struct geometry_id
0041 {
0042     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0043         "Not implemented for this Geometry type.",
0044         GeometryTag);
0045 };
0046 
0047 
0048 template <>
0049 struct geometry_id<point_tag>               : std::integral_constant<int, 1> {};
0050 
0051 
0052 template <>
0053 struct geometry_id<linestring_tag>          : std::integral_constant<int, 2> {};
0054 
0055 
0056 template <>
0057 struct geometry_id<polygon_tag>             : std::integral_constant<int, 3> {};
0058 
0059 
0060 template <>
0061 struct geometry_id<multi_point_tag>         : std::integral_constant<int, 4> {};
0062 
0063 
0064 template <>
0065 struct geometry_id<multi_linestring_tag>    : std::integral_constant<int, 5> {};
0066 
0067 
0068 template <>
0069 struct geometry_id<multi_polygon_tag>       : std::integral_constant<int, 6> {};
0070 
0071 
0072 template <>
0073 struct geometry_id<geometry_collection_tag> : std::integral_constant<int, 7> {};
0074 
0075 
0076 template <>
0077 struct geometry_id<segment_tag>             : std::integral_constant<int, 92> {};
0078 
0079 
0080 template <>
0081 struct geometry_id<ring_tag>                : std::integral_constant<int, 93> {};
0082 
0083 
0084 template <>
0085 struct geometry_id<box_tag>                 : std::integral_constant<int, 94> {};
0086 
0087 
0088 } // namespace core_dispatch
0089 #endif
0090 
0091 
0092 
0093 /*!
0094 \brief Meta-function returning the id of a geometry type
0095 \details The meta-function geometry_id defines a numerical ID (based on
0096     std::integral_constant<int, ...> ) for each geometry concept. A numerical ID is
0097     sometimes useful, and within Boost.Geometry it is used for the
0098     reverse_dispatch metafuntion.
0099 \note Used for e.g. reverse meta-function
0100 \ingroup core
0101 */
0102 template <typename Geometry>
0103 struct geometry_id : core_dispatch::geometry_id<tag_t<Geometry>>
0104 {};
0105 
0106 
0107 #ifndef BOOST_NO_CXX17_INLINE_VARIABLES
0108 template <typename GeometryTag>
0109 inline constexpr int geometry_id_v = geometry_id<GeometryTag>::value;
0110 #endif
0111 
0112 
0113 }} // namespace boost::geometry
0114 
0115 
0116 #endif // BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP