1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
11 // Use, modification and distribution is subject to the Boost Software License,
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
15 #ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
16 #define BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
21 #include <boost/concept/requires.hpp>
23 #include <boost/geometry/core/tags.hpp>
24 #include <boost/geometry/geometries/concepts/linestring_concept.hpp>
26 #include <boost/config.hpp>
27 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
28 #include <initializer_list>
31 namespace boost { namespace geometry
39 \brief multi_line, a collection of linestring
40 \details Multi-linestring can be used to group lines belonging to each other,
41 e.g. a highway (with interruptions)
44 \qbk{[include reference/geometries/multi_linestring.qbk]}
47 [link geometry.reference.concepts.concept_multi_linestring MultiLineString Concept]
53 template<typename, typename> class Container = std::vector,
54 template<typename> class Allocator = std::allocator
56 class multi_linestring : public Container<LineString, Allocator<LineString> >
58 BOOST_CONCEPT_ASSERT( (concepts::Linestring<LineString>) );
60 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
62 // default constructor and base_type definitions are required only
63 // if the constructor taking std::initializer_list is defined
65 typedef Container<LineString, Allocator<LineString> > base_type;
68 /// \constructor_default{multi_linestring}
73 /// \constructor_initializer_list{multi_linestring}
74 inline multi_linestring(std::initializer_list<LineString> l)
75 : base_type(l.begin(), l.end())
78 // Commented out for now in order to support Boost.Assign
79 // Without this assignment operator first the object should be created
80 // from initializer list, then it shoudl be moved.
81 //// Without this workaround in MSVC the assignment operator is ambiguous
83 // /// \assignment_initializer_list{multi_linestring}
84 // inline multi_linestring & operator=(std::initializer_list<LineString> l)
86 // base_type::assign(l.begin(), l.end());
98 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
105 template<typename, typename> class Container,
106 template<typename> class Allocator
108 struct tag< model::multi_linestring<LineString, Container, Allocator> >
110 typedef multi_linestring_tag type;
113 } // namespace traits
114 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
117 }} // namespace boost::geometry
119 #endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP