GEOS 3.3.1
GeometryList.h
00001 /**********************************************************************
00002  * $Id: GeometryList.h 3255 2011-03-01 17:56:10Z 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/export.h>
00024 #include <geos/geom/Geometry.h> // for auto_ptr
00025 
00026 #include <memory> // for auto_ptr
00027 #include <vector> 
00028 
00029 #ifdef _MSC_VER
00030 #pragma warning(push)
00031 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00032 #endif
00033 
00034 namespace geos {
00035 namespace geom { // geos.geom
00036 
00037 
00041 class GEOS_DLL GeometryList {
00042 
00043 public:
00044 
00046         friend class std::auto_ptr<GeometryList>;
00047 
00048         typedef std::vector<Geometry*>::size_type size_type;
00049 
00052         typedef std::auto_ptr<GeometryList> AutoPtr;
00053 
00055         static GeometryList::AutoPtr create();
00056 
00058         void add(Geometry::AutoPtr geom);
00059 
00061         size_type size() const;
00062 
00064         Geometry* operator[] (size_type);
00065 
00067         const Geometry* operator[] (size_type) const;
00068 
00069 private:
00070 
00071         std::vector<Geometry*> geoms;
00072 
00073         GeometryList();
00074         ~GeometryList();
00075 };
00076 
00077 } // namespace geos.geom
00078 } // namespace geos
00079 
00080 #ifdef _MSC_VER
00081 #pragma warning(pop)
00082 #endif
00083 
00084 #endif // GEOS_GEOM_GEOMETRYLIST_H
00085 
00086 /**********************************************************************
00087  * $Log$
00088  * Revision 1.2  2006/04/11 09:53:44  strk
00089  * Added missing duplicated include sentinel
00090  *
00091  * Revision 1.1  2006/04/11 09:41:26  strk
00092  * Initial implementation of a GeometryList class, to be used to manage
00093  * lists of Geometry pointers.
00094  *
00095  **********************************************************************/
00096