geometry_collection.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Boost.Geometry
  2. // Copyright (c) 2021, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #ifndef BOOST_GEOMETRY_GEOMETRIES_GEOMETRY_COLLECTION_HPP
  7. #define BOOST_GEOMETRY_GEOMETRIES_GEOMETRY_COLLECTION_HPP
  8. #include <vector>
  9. #include <boost/geometry/core/tag.hpp>
  10. #include <boost/geometry/core/tags.hpp>
  11. namespace boost { namespace geometry
  12. {
  13. namespace model
  14. {
  15. /*!
  16. \brief Basic geometry_collection class representing a container of DynamicGeometries.
  17. \ingroup geometries
  18. \tparam DynamicGeometry Type adapted to DynamicGeometry Concept.
  19. \tparam Container \tparam_container
  20. \tparam Allocator \tparam_allocator
  21. */
  22. template
  23. <
  24. typename DynamicGeometry,
  25. template <typename, typename> class Container = std::vector,
  26. template <typename> class Allocator = std::allocator
  27. >
  28. class geometry_collection
  29. : public Container<DynamicGeometry, Allocator<DynamicGeometry>>
  30. {
  31. typedef Container<DynamicGeometry, Allocator<DynamicGeometry>> base_type;
  32. public:
  33. geometry_collection() = default;
  34. geometry_collection(std::initializer_list<DynamicGeometry> l)
  35. : base_type(l.begin(), l.end())
  36. {}
  37. };
  38. } // namespace model
  39. #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  40. namespace traits
  41. {
  42. template
  43. <
  44. typename DynamicGeometry,
  45. template <typename, typename> class Container,
  46. template <typename> class Allocator
  47. >
  48. struct tag<model::geometry_collection<DynamicGeometry, Container, Allocator>>
  49. {
  50. using type = geometry_collection_tag;
  51. };
  52. } // namespace traits
  53. #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
  54. }} // namespace boost::geometry
  55. #endif // BOOST_GEOMETRY_GEOMETRIES_GEOMETRY_COLLECTION_HPP