21 #ifndef GEOS_GEOM_COORDINATELIST_H
22 #define GEOS_GEOM_COORDINATELIST_H
24 #include <geos/export.h>
25 #include <geos/geom/Coordinate.h>
33 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
60 typedef std::list<Coordinate>::iterator iterator;
61 typedef std::list<Coordinate>::const_iterator const_iterator;
62 typedef std::list<Coordinate>::size_type size_type;
64 friend std::ostream&
operator<< (std::ostream& os,
78 coords(v.begin(), v.end())
88 size_type size()
const
95 return coords.empty();
100 return coords.begin();
108 const_iterator begin()
const
110 return coords.begin();
113 const_iterator end()
const
131 iterator insert(iterator pos,
const Coordinate& c,
bool allowRepeated)
133 if ( !allowRepeated && pos != coords.begin() ) {
134 iterator prev = pos; --prev;
135 if ( c.equals2D(*prev) )
return prev;
137 return coords.insert(pos, c);
140 iterator insert(iterator pos,
const Coordinate& c)
142 return coords.insert(pos, c);
145 iterator erase(iterator pos)
147 return coords.erase(pos);
150 iterator erase(iterator first, iterator last)
152 return coords.erase(first, last);
155 std::auto_ptr<Coordinate::Vect> toCoordinateArray()
const
158 ret->assign(coords.begin(), coords.end());
164 std::list<Coordinate> coords;
168 std::ostream&
operator<< (std::ostream& os,
const CoordinateList& cl)
171 for (CoordinateList::const_iterator
172 it=cl.begin(), end=cl.end();
176 const Coordinate& c = *it;
177 if ( it != cl.begin() ) os <<
", ";
192 #endif // ndef GEOS_GEOM_COORDINATELIST_H