File indexing completed on 2025-09-18 08:43:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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 }
0089 #endif
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
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 }}
0114
0115
0116 #endif