GEOS  3.4.2
GeometryList.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: ORIGINAL WORK
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_GEOM_GEOMETRYLIST_H
20 #define GEOS_GEOM_GEOMETRYLIST_H
21 
22 #include <geos/export.h>
23 #include <geos/geom/Geometry.h> // for auto_ptr
24 
25 #include <memory> // for auto_ptr
26 #include <vector>
27 
28 #ifdef _MSC_VER
29 #pragma warning(push)
30 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
31 #endif
32 
33 namespace geos {
34 namespace geom { // geos.geom
35 
36 
40 class GEOS_DLL GeometryList {
41 
42 public:
43 
45  friend class std::auto_ptr<GeometryList>;
46 
47  typedef std::vector<Geometry*>::size_type size_type;
48 
51  typedef std::auto_ptr<GeometryList> AutoPtr;
52 
54  static GeometryList::AutoPtr create();
55 
57  void add(Geometry::AutoPtr geom);
58 
60  size_type size() const;
61 
63  Geometry* operator[] (size_type);
64 
66  const Geometry* operator[] (size_type) const;
67 
68 private:
69 
70  std::vector<Geometry*> geoms;
71 
72  GeometryList();
73  ~GeometryList();
74 };
75 
76 } // namespace geos.geom
77 } // namespace geos
78 
79 #ifdef _MSC_VER
80 #pragma warning(pop)
81 #endif
82 
83 #endif // GEOS_GEOM_GEOMETRYLIST_H
Manager of Geometry pointers. Owns the Geometries.
Definition: GeometryList.h:40
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
std::auto_ptr< Geometry > AutoPtr
An auto_ptr of Geometry.
Definition: Geometry.h:180
std::auto_ptr< GeometryList > AutoPtr
Definition: GeometryList.h:51