Libosmium
2.10.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <object_pointer_collection.hpp>
Public Types | |
using | iterator = boost::indirect_iterator< std::vector< osmium::OSMObject * >::iterator, osmium::OSMObject > |
using | const_iterator = boost::indirect_iterator< std::vector< osmium::OSMObject * >::const_iterator, const osmium::OSMObject > |
Public Member Functions | |
ObjectPointerCollection () noexcept | |
void | osm_object (osmium::OSMObject &object) |
template<typename TCompare > | |
void | sort (TCompare &&compare) |
iterator | begin () |
iterator | end () |
const_iterator | cbegin () const |
const_iterator | cend () const |
![]() | |
void | osm_object (const osmium::OSMObject &) const noexcept |
void | node (const osmium::Node &) const noexcept |
void | way (const osmium::Way &) const noexcept |
void | relation (const osmium::Relation &) const noexcept |
void | area (const osmium::Area &) const noexcept |
void | changeset (const osmium::Changeset &) const noexcept |
void | tag_list (const osmium::TagList &) const noexcept |
void | way_node_list (const osmium::WayNodeList &) const noexcept |
void | relation_member_list (const osmium::RelationMemberList &) const noexcept |
void | outer_ring (const osmium::OuterRing &) const noexcept |
void | inner_ring (const osmium::InnerRing &) const noexcept |
void | changeset_discussion (const osmium::ChangesetDiscussion &) const noexcept |
void | flush () const noexcept |
Private Attributes | |
std::vector< osmium::OSMObject * > | m_objects |
A collection of pointers to OSM objects. The pointers can be easily and quickly sorted or otherwise manipulated, while the objects themselves or the buffers they are in, do not have to be changed.
An iterator is provided that can iterate over the pointers but looks like it is iterating over the underlying OSM objects.
This class implements the visitor pattern which makes it easy to populate the collection from a buffer of OSM objects:
osmium::ObjectPointerCollection objects; osmium::memory::Buffer buffer = reader.read(); osmium::apply(buffer, objects);
using osmium::ObjectPointerCollection::const_iterator = boost::indirect_iterator<std::vector<osmium::OSMObject*>::const_iterator, const osmium::OSMObject> |
using osmium::ObjectPointerCollection::iterator = boost::indirect_iterator<std::vector<osmium::OSMObject*>::iterator, osmium::OSMObject> |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sort objects according to the given order functor.
|
private |