00001 /********************************************************************** 00002 * $Id: GeometryList.h 1820 2006-09-06 16:54:23Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 ********************************************************************** 00015 * 00016 * Last port: ORIGINAL WORK 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_GEOM_GEOMETRYLIST_H 00021 #define GEOS_GEOM_GEOMETRYLIST_H 00022 00023 #include <geos/geom/Geometry.h> // for auto_ptr 00024 00025 #include <memory> // for auto_ptr 00026 #include <vector> 00027 00028 namespace geos { 00029 namespace geom { // geos.geom 00030 00031 00035 class GeometryList { 00036 00037 public: 00038 00040 friend class std::auto_ptr<GeometryList>; 00041 00042 typedef std::vector<Geometry*>::size_type size_type; 00043 00046 typedef std::auto_ptr<GeometryList> AutoPtr; 00047 00049 static GeometryList::AutoPtr create(); 00050 00052 void add(Geometry::AutoPtr geom); 00053 00055 size_type size() const; 00056 00058 Geometry* operator[] (size_type); 00059 00061 const Geometry* operator[] (size_type) const; 00062 00063 private: 00064 00065 std::vector<Geometry*> geoms; 00066 00067 GeometryList(); 00068 00069 ~GeometryList(); 00070 00071 }; 00072 00073 } // namespace geos.geom 00074 } // namespace geos 00075 00076 #endif // GEOS_GEOM_GEOMETRYLIST_H 00077 00078 /********************************************************************** 00079 * $Log$ 00080 * Revision 1.2 2006/04/11 09:53:44 strk 00081 * Added missing duplicated include sentinel 00082 * 00083 * Revision 1.1 2006/04/11 09:41:26 strk 00084 * Initial implementation of a GeometryList class, to be used to manage 00085 * lists of Geometry pointers. 00086 * 00087 **********************************************************************/ 00088