1 // Boost.Geometry Index
5 // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_INDEX_INSERTER_HPP
12 #define BOOST_GEOMETRY_INDEX_INSERTER_HPP
17 \defgroup inserters Inserters (boost::geometry::index::)
20 namespace boost { namespace geometry { namespace index {
22 template <class Container>
23 class insert_iterator :
24 public std::iterator<std::output_iterator_tag, void, void, void, void>
27 typedef Container container_type;
29 inline explicit insert_iterator(Container & c)
33 insert_iterator & operator=(typename Container::value_type const& value)
35 container->insert(value);
39 insert_iterator & operator* ()
44 insert_iterator & operator++ ()
49 insert_iterator operator++(int)
55 Container * container;
59 \brief Insert iterator generator.
61 Returns insert iterator capable to insert values to the container
62 (spatial index) which has member function insert(value_type const&) defined.
66 \param c The reference to the container (spatial index) to which values will be inserted.
68 \return The insert iterator inserting values to the container.
70 template <typename Container>
71 insert_iterator<Container> inserter(Container & c)
73 return insert_iterator<Container>(c);
76 }}} // namespace boost::geometry::index
78 #endif // BOOST_GEOMETRY_INDEX_INSERTER_HPP