// Boost.Geometry // Copyright (c) 2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { namespace concepts { namespace detail { template < typename Geometry, typename SubGeometry, typename Tag = typename tag::type, bool IsSubDynamicOrCollection = util::is_dynamic_geometry::value || util::is_geometry_collection::value > struct GeometryType; // Prevent recursive concept checking template struct GeometryType {}; template struct GeometryType {}; template struct GeometryType : concepts::concept_type::type { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS BOOST_CONCEPT_USAGE(GeometryType) { Geometry* gc = nullptr; SubGeometry* sg = nullptr; traits::emplace_back::apply(*gc, std::move(*sg)); } #endif // DOXYGEN_NO_CONCEPT_MEMBERS }; template struct GeometryType : concepts::concept_type::type {}; template struct GeometryTypesPack {}; template struct GeometryTypesPack : GeometryTypesPack , GeometryType {}; template struct GeometryTypes; template struct GeometryTypes> : GeometryTypesPack {}; } // namespace detail template struct GeometryCollection : boost::ForwardRangeConcept { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS using sequence_t = typename traits::geometry_types::type; BOOST_CONCEPT_ASSERT( (detail::GeometryTypes) ); BOOST_CONCEPT_USAGE(GeometryCollection) { Geometry* gc = nullptr; traits::clear::apply(*gc); traits::iter_visit::apply([](auto &&) {}, boost::begin(*gc)); } #endif // DOXYGEN_NO_CONCEPT_MEMBERS }; template struct ConstGeometryCollection : boost::ForwardRangeConcept { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS using sequence_t = typename traits::geometry_types::type; BOOST_CONCEPT_ASSERT( (detail::GeometryTypes) ); BOOST_CONCEPT_USAGE(ConstGeometryCollection) { Geometry const* gc = nullptr; traits::iter_visit::apply([](auto &&) {}, boost::begin(*gc)); } #endif // DOXYGEN_NO_CONCEPT_MEMBERS }; template struct concept_type { using type = GeometryCollection; }; template struct concept_type { using type = ConstGeometryCollection; }; }}} // namespace boost::geometry::concepts #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP