multi_modify.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2017-2021.
  6. // Modifications copyright (c) 2017-2021 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP
  14. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP
  15. #include <boost/range/begin.hpp>
  16. #include <boost/range/end.hpp>
  17. namespace boost { namespace geometry
  18. {
  19. #ifndef DOXYGEN_NO_DETAIL
  20. namespace detail
  21. {
  22. template <typename Policy>
  23. struct multi_modify
  24. {
  25. template <typename MultiGeometry>
  26. static inline void apply(MultiGeometry& multi)
  27. {
  28. auto const end = boost::end(multi);
  29. for (auto it = boost::begin(multi); it != end; ++it)
  30. {
  31. Policy::apply(*it);
  32. }
  33. }
  34. template <typename MultiGeometry, typename Strategy>
  35. static inline void apply(MultiGeometry& multi, Strategy const& strategy)
  36. {
  37. auto const end = boost::end(multi);
  38. for (auto it = boost::begin(multi); it != end; ++it)
  39. {
  40. Policy::apply(*it, strategy);
  41. }
  42. }
  43. };
  44. } // namespace detail
  45. #endif
  46. }} // namespace boost::geometry
  47. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP