osmium::ObjectPointerCollection Class Reference

`#include <object_pointer_collection.hpp>`

Inheritance diagram for osmium::ObjectPointerCollection:
[legend]
Collaboration diagram for osmium::ObjectPointerCollection:
[legend]

## Public Types

typedef boost::indirect_iterator< std::vector< osmium::OSMObject * >::iterator, osmium::OSMObject > | iterator
typedef boost::indirect_iterator< std::vector< osmium::OSMObject * >::const_iterator, const osmium::OSMObject > | const_iterator

## 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
Public Member Functions inherited from osmium::handler::Handler
void | osm_object (const osmium::OSMObject &) const
void | node (const osmium::Node &) const
void | way (const osmium::Way &) const
void | relation (const osmium::Relation &) const
void | area (const osmium::Area &) const
void | changeset (const osmium::Changeset &) const
void | tag_list (const osmium::TagList &) const
void | way_node_list (const osmium::WayNodeList &) const
void | relation_member_list (const osmium::RelationMemberList &) const
void | outer_ring (const osmium::OuterRing &) const
void | inner_ring (const osmium::InnerRing &) const
void | changeset_discussion (const osmium::ChangesetDiscussion &) const
void | flush () const

## Private Attributes

std::vector< osmium::OSMObject * > | m_objects

## Detailed Description

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);

## Member Typedef Documentation

typedef boost::indirect_iterator<std::vector<osmium::OSMObject*>::const_iterator, const osmium::OSMObject> osmium::ObjectPointerCollection::const_iterator

typedef boost::indirect_iterator<std::vector<osmium::OSMObject*>::iterator, osmium::OSMObject> osmium::ObjectPointerCollection::iterator

## Constructor & Destructor Documentation

osmium::ObjectPointerCollection::ObjectPointerCollection | ( |  | ) |

inline noexcept

## Member Function Documentation

iterator osmium::ObjectPointerCollection::begin | ( |  | ) |

inline

const_iterator osmium::ObjectPointerCollection::cbegin | ( |  | ) | const

inline

const_iterator osmium::ObjectPointerCollection::cend | ( |  | ) | const

inline

iterator osmium::ObjectPointerCollection::end | ( |  | ) |

inline

void osmium::ObjectPointerCollection::osm_object | ( | osmium::OSMObject & | object | ) |

inline

template<typename TCompare >

void osmium::ObjectPointerCollection::sort | ( | TCompare && | compare | ) |

inline

Sort objects according to the given order functor.

## Member Data Documentation

std::vector<osmium::OSMObject*> osmium::ObjectPointerCollection::m_objects

private

The documentation for this class was generated from the following file:

- osmium/object_pointer_collection.hpp