/usr/include/geos/operation/union/GeometryListHolder.h is in libgeos++-dev 3.6.2-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@keybit.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.
*
**********************************************************************/
#ifndef GEOS_OP_UNION_GEOMETRYLISTHOLDER_H
#define GEOS_OP_UNION_GEOMETRYLISTHOLDER_H
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
}
}
namespace geos {
namespace operation { // geos::operation
namespace geounion { // geos::operation::geounion
/**
* \brief Helper class holding Geometries, part of which are held by reference
* others are held exclusively.
*/
class GeometryListHolder : public std::vector<geom::Geometry*>
{
private:
typedef std::vector<geom::Geometry*> base_type;
public:
GeometryListHolder() {}
~GeometryListHolder()
{
std::for_each(ownedItems.begin(), ownedItems.end(),
&GeometryListHolder::deleteItem);
}
// items need to be deleted in the end
void push_back_owned(geom::Geometry* item)
{
this->base_type::push_back(item);
ownedItems.push_back(item);
}
geom::Geometry* getGeometry(std::size_t index)
{
if (index >= this->base_type::size())
return NULL;
return (*this)[index];
}
private:
static void deleteItem(geom::Geometry* item);
private:
std::vector<geom::Geometry*> ownedItems;
};
} // namespace geos::operation::union
} // namespace geos::operation
} // namespace geos
#endif
|