multi_linestring_concept.hpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 2020-2021.
  6. // Modifications copyright (c) 2020-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_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
  14. #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
  15. #include <boost/concept_check.hpp>
  16. #include <boost/range/concepts.hpp>
  17. #include <boost/range/value_type.hpp>
  18. #include <boost/geometry/geometries/concepts/concept_type.hpp>
  19. #include <boost/geometry/geometries/concepts/linestring_concept.hpp>
  20. namespace boost { namespace geometry { namespace concepts
  21. {
  22. template <typename Geometry>
  23. class MultiLinestring
  24. {
  25. #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
  26. typedef typename boost::range_value<Geometry>::type linestring_type;
  27. BOOST_CONCEPT_ASSERT( (concepts::Linestring<linestring_type>) );
  28. BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
  29. public :
  30. BOOST_CONCEPT_USAGE(MultiLinestring)
  31. {
  32. Geometry* mls = 0;
  33. traits::clear<Geometry>::apply(*mls);
  34. traits::resize<Geometry>::apply(*mls, 0);
  35. linestring_type* ls = 0;
  36. traits::push_back<Geometry>::apply(*mls, std::move(*ls));
  37. }
  38. #endif
  39. };
  40. /*!
  41. \brief concept for multi-linestring (const version)
  42. \ingroup const_concepts
  43. */
  44. template <typename Geometry>
  45. class ConstMultiLinestring
  46. {
  47. #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
  48. typedef typename boost::range_value<Geometry>::type linestring_type;
  49. BOOST_CONCEPT_ASSERT( (concepts::ConstLinestring<linestring_type>) );
  50. BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
  51. public :
  52. BOOST_CONCEPT_USAGE(ConstMultiLinestring)
  53. {
  54. }
  55. #endif
  56. };
  57. template <typename Geometry>
  58. struct concept_type<Geometry, multi_linestring_tag>
  59. {
  60. using type = MultiLinestring<Geometry>;
  61. };
  62. template <typename Geometry>
  63. struct concept_type<Geometry const, multi_linestring_tag>
  64. {
  65. using type = ConstMultiLinestring<Geometry>;
  66. };
  67. }}} // namespace boost::geometry::concepts
  68. #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP