Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:50:01

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2013-2020.
0006 // Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
0007 
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_IMPL_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_IMPL_HPP
0016 
0017 #include <type_traits>
0018 
0019 #include <boost/geometry/algorithms/detail/relate/interface.hpp>
0020 #include <boost/geometry/algorithms/not_implemented.hpp>
0021 #include <boost/geometry/core/tag.hpp>
0022 
0023 namespace boost { namespace geometry {
0024 
0025 
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail { namespace relate {
0028 
0029 struct implemented_tag {};
0030 
0031 template
0032 <
0033     typename Geometry1,
0034     typename Geometry2
0035 >
0036 struct relate_impl_base
0037     : std::conditional_t
0038         <
0039             std::is_base_of
0040                 <
0041                     nyi::not_implemented_tag,
0042                     dispatch::relate<Geometry1, Geometry2>
0043                 >::value,
0044             not_implemented
0045                 <
0046                     geometry::tag_t<Geometry1>,
0047                     geometry::tag_t<Geometry2>
0048                 >,
0049             implemented_tag
0050         >
0051 {};
0052 
0053 template
0054 <
0055     typename Geometry1,
0056     typename Geometry2,
0057     typename StaticMask
0058 >
0059 struct relate_impl_dispatch
0060     : relate_impl_base<Geometry1, Geometry2>
0061 {
0062     template <typename Strategy>
0063     static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy)
0064     {
0065         typename detail::relate::result_handler_type
0066             <
0067                 Geometry1,
0068                 Geometry2,
0069                 StaticMask
0070             >::type handler;
0071 
0072         dispatch::relate<Geometry1, Geometry2>::apply(g1, g2, handler, strategy);
0073 
0074         return handler.result();
0075     }
0076 };
0077 
0078 template <typename Geometry1, typename Geometry2>
0079 struct relate_impl_dispatch<Geometry1, Geometry2, detail::relate::false_mask>
0080     : relate_impl_base<Geometry1, Geometry2>
0081 {
0082     template <typename Strategy>
0083     static inline bool apply(Geometry1 const& , Geometry2 const& , Strategy const& )
0084     {
0085         return false;
0086     }
0087 };
0088 
0089 template
0090 <
0091     template <typename, typename> class StaticMaskTrait,
0092     typename Geometry1,
0093     typename Geometry2
0094 >
0095 struct relate_impl
0096     : relate_impl_dispatch
0097         <
0098             Geometry1,
0099             Geometry2,
0100             typename StaticMaskTrait<Geometry1, Geometry2>::type
0101         >
0102 {};
0103 
0104 }} // namespace detail::relate
0105 #endif // DOXYGEN_NO_DETAIL
0106 
0107 }} // namespace boost::geometry
0108 
0109 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_IMPL_HPP