1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
/**********************************************************************
* $Id: GeometryList.cpp 1820 2006-09-06 16:54:23Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: ORIGINAL WORK
*
**********************************************************************/
#include <geos/geom/GeometryList.h>
#include <geos/geom/Geometry.h> // for auto_ptr
#include <memory> // for auto_ptr
#include <vector>
namespace geos {
namespace geom { // geos.geom
/*private*/
GeometryList::GeometryList()
{
}
/*private*/
GeometryList::~GeometryList()
{
for (std::vector<Geometry*>::size_type i=0, n=geoms.size(); i<n; i++)
{
delete geoms[i];
}
}
/*public static*/
GeometryList::AutoPtr
GeometryList::create()
{
return GeometryList::AutoPtr(new GeometryList());
}
/*public*/
void
GeometryList::add(Geometry::AutoPtr geom)
{
geoms.push_back(geom.release());
}
/*public*/
Geometry *
GeometryList::operator[] (GeometryList::size_type i)
{
return geoms[i];
}
/*public*/
const Geometry *
GeometryList::operator[] (GeometryList::size_type i) const
{
return geoms[i];
}
} // namespace geos.geom
} // namespace geos
/**********************************************************************
* $Log$
* Revision 1.1 2006/04/11 09:41:26 strk
* Initial implementation of a GeometryList class, to be used to manage
* lists of Geometry pointers.
*
**********************************************************************/
|