Libosmium 2.22.0 Fast and flexible C++ library for working with OpenStreetMap data

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
osmium::relations::RelationsManagerBase Class Reference

`#include <relations_manager.hpp>`

Inheritance diagram for osmium::relations::RelationsManagerBase:
[legend]
Collaboration diagram for osmium::relations::RelationsManagerBase:
[legend]

## Public Member Functions
| RelationsManagerBase ()
osmium::relations::RelationsDatabase & | relations_database () noexcept
| Access the internal RelationsDatabase.
osmium::relations::MembersDatabase< osmium::Node > & | member_nodes_database () noexcept
| Access the internal database containing member nodes.
const osmium::relations::MembersDatabase< osmium::Node > & | member_nodes_database () const noexcept
| Access the internal database containing member nodes.
osmium::relations::MembersDatabase< osmium::Way > & | member_ways_database () noexcept
| Access the internal database containing member ways.
const osmium::relations::MembersDatabase< osmium::Way > & | member_ways_database () const noexcept
| Access the internal database containing member ways.
osmium::relations::MembersDatabase< osmium::Relation > & | member_relations_database () noexcept
| Access the internal database containing member relations.
const osmium::relations::MembersDatabase< osmium::Relation > & | member_relations_database () const noexcept
| Access the internal database containing member relations.
relations::MembersDatabaseCommon & | member_database (osmium::item_type type) noexcept
const relations::MembersDatabaseCommon & | member_database (osmium::item_type type) const noexcept
const osmium::OSMObject * | get_member_object (const osmium::RelationMember &member) const noexcept
const osmium::Node * | get_member_node (osmium::object_id_type id) const noexcept
const osmium::Way * | get_member_way (osmium::object_id_type id) const noexcept
const osmium::Relation * | get_member_relation (osmium::object_id_type id) const noexcept
void | prepare_for_lookup ()
relations_manager_memory_usage | used_memory () const noexcept
osmium::memory::Buffer & | buffer () noexcept
| Access the output buffer.
void | set_callback (const std::function< void(osmium::memory::Buffer &&)> &callback)
| Set the callback called when the output buffer is full.
void | flush_output ()
| Flush the output buffer.
void | possibly_flush ()
| Flush the output buffer if it is full.
osmium::memory::Buffer | read ()
| Return the contents of the output buffer.
Public Member Functions inherited from osmium::handler::Handler
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
osmium::ItemStash | m_stash
relations::RelationsDatabase | m_relations_db
| Database of all relations we are interested in.
relations::MembersDatabase< osmium::Node > | m_member_nodes_db
| Databases of all members we are interested in.
relations::MembersDatabase< osmium::Way > | m_member_ways_db
relations::MembersDatabase< osmium::Relation > | m_member_relations_db
osmium::memory::CallbackBuffer | m_output
| Output buffer.

## Detailed Description

This is a base class of the RelationsManager class template. It contains databases for the relations and the members that we need to keep track of and handles the ouput buffer. Unlike the RelationsManager class template this is a plain class.

Usually it is better to use the RelationsManager class template as a basis for your code, but you can also use this class if you have special needs.

## Constructor & Destructor Documentation

## ◆ RelationsManagerBase()

osmium::relations::RelationsManagerBase::RelationsManagerBase | ( |  | ) |
| inline

## Member Function Documentation

## ◆ buffer()

osmium::memory::Buffer & osmium::relations::RelationsManagerBase::buffer | ( |  | ) |
| inline noexcept

Access the output buffer.

## ◆ flush_output()

void osmium::relations::RelationsManagerBase::flush_output | ( |  | ) |
| inline

Flush the output buffer.

## ◆ get_member_node()

const osmium::Node * osmium::relations::RelationsManagerBase::get_member_node | ( | osmium::object_id_type | id | ) | const
| inline noexcept

Get node with specified ID from members database.

Parameters

  id | The node ID we are looking for.

Returns
  A pointer to the member node if it is available. Returns nullptr otherwise.

## ◆ get_member_object()

const osmium::OSMObject * osmium::relations::RelationsManagerBase::get_member_object | ( | const osmium::RelationMember & | member | ) | const
| inline noexcept

Get member object from relation member.

Returns
  A pointer to the member object if it is available. Returns nullptr otherwise.

## ◆ get_member_relation()

const osmium::Relation * osmium::relations::RelationsManagerBase::get_member_relation | ( | osmium::object_id_type | id | ) | const
| inline noexcept

Get relation with specified ID from members database.

Parameters

  id | The relation ID we are looking for.

Returns
  A pointer to the member relation if it is available. Returns nullptr otherwise.

## ◆ get_member_way()

const osmium::Way * osmium::relations::RelationsManagerBase::get_member_way | ( | osmium::object_id_type | id | ) | const
| inline noexcept

Get way with specified ID from members database.

Parameters

  id | The way ID we are looking for.

Returns
  A pointer to the member way if it is available. Returns nullptr otherwise.

## ◆ member_database() [1/2]

const relations::MembersDatabaseCommon & osmium::relations::RelationsManagerBase::member_database | ( | osmium::item_type | type | ) | const
| inline noexcept

Access the internal database containing members of the specified type (const version of this function).

Parameters

  type | osmium::item_type::node, way, or relation.

## ◆ member_database() [2/2]

relations::MembersDatabaseCommon & osmium::relations::RelationsManagerBase::member_database | ( | osmium::item_type | type | ) |
| inline noexcept

Access the internal database containing members of the specified type (non-const version of this function).

Parameters

  type | osmium::item_type::node, way, or relation.

## ◆ member_nodes_database() [1/2]

const osmium::relations::MembersDatabase< osmium::Node > & osmium::relations::RelationsManagerBase::member_nodes_database | ( |  | ) | const
| inline noexcept

Access the internal database containing member nodes.

## ◆ member_nodes_database() [2/2]

osmium::relations::MembersDatabase< osmium::Node > & osmium::relations::RelationsManagerBase::member_nodes_database | ( |  | ) |
| inline noexcept

Access the internal database containing member nodes.

## ◆ member_relations_database() [1/2]

const osmium::relations::MembersDatabase< osmium::Relation > & osmium::relations::RelationsManagerBase::member_relations_database | ( |  | ) | const
| inline noexcept

Access the internal database containing member relations.

## ◆ member_relations_database() [2/2]

osmium::relations::MembersDatabase< osmium::Relation > & osmium::relations::RelationsManagerBase::member_relations_database | ( |  | ) |
| inline noexcept

Access the internal database containing member relations.

## ◆ member_ways_database() [1/2]

const osmium::relations::MembersDatabase< osmium::Way > & osmium::relations::RelationsManagerBase::member_ways_database | ( |  | ) | const
| inline noexcept

Access the internal database containing member ways.

## ◆ member_ways_database() [2/2]

osmium::relations::MembersDatabase< osmium::Way > & osmium::relations::RelationsManagerBase::member_ways_database | ( |  | ) |
| inline noexcept

Access the internal database containing member ways.

## ◆ possibly_flush()

void osmium::relations::RelationsManagerBase::possibly_flush | ( |  | ) |
| inline

Flush the output buffer if it is full.

## ◆ prepare_for_lookup()

void osmium::relations::RelationsManagerBase::prepare_for_lookup | ( |  | ) |
| inline

Sort the members databases to prepare them for reading. Usually this is called between the first and second pass reading through an OSM data file.

## ◆ read()

osmium::memory::Buffer osmium::relations::RelationsManagerBase::read | ( |  | ) |
| inline

Return the contents of the output buffer.

## ◆ relations_database()

osmium::relations::RelationsDatabase & osmium::relations::RelationsManagerBase::relations_database | ( |  | ) |
| inline noexcept

Access the internal RelationsDatabase.

## ◆ set_callback()

void osmium::relations::RelationsManagerBase::set_callback | ( | const std::function< void(osmium::memory::Buffer &&)> & | callback | ) |
| inline

Set the callback called when the output buffer is full.

## ◆ used_memory()

relations_manager_memory_usage osmium::relations::RelationsManagerBase::used_memory | ( |  | ) | const
| inline noexcept

Return the memory used by different components of the manager.

## Member Data Documentation

## ◆ m_member_nodes_db

relations::MembersDatabase<osmium::Node> osmium::relations::RelationsManagerBase::m_member_nodes_db
| private

Databases of all members we are interested in.

## ◆ m_member_relations_db

relations::MembersDatabase<osmium::Relation> osmium::relations::RelationsManagerBase::m_member_relations_db
| private

## ◆ m_member_ways_db

relations::MembersDatabase<osmium::Way> osmium::relations::RelationsManagerBase::m_member_ways_db
| private

## ◆ m_output

osmium::memory::CallbackBuffer osmium::relations::RelationsManagerBase::m_output
| private

Output buffer.

## ◆ m_relations_db

relations::RelationsDatabase osmium::relations::RelationsManagerBase::m_relations_db
| private

Database of all relations we are interested in.

## ◆ m_stash

osmium::ItemStash osmium::relations::RelationsManagerBase::m_stash
| private

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

- include/osmium/relations/relations_manager.hpp