Libosmium  2.11.3
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
osmium::index::RelationsMapIndex Class Reference

#include <relations_map.hpp>

Collaboration diagram for osmium::index::RelationsMapIndex:
Collaboration graph
[legend]

Public Member Functions

 RelationsMapIndex ()=delete
 
 RelationsMapIndex (const RelationsMapIndex &)=delete
 
RelationsMapIndexoperator= (const RelationsMapIndex &)=delete
 
 RelationsMapIndex (RelationsMapIndex &&)=default
 
RelationsMapIndexoperator= (RelationsMapIndex &&)=default
 
template<typename Func >
void for_each_parent (osmium::unsigned_object_id_type member_id, Func &&func) const
 
bool empty () const noexcept
 
size_t size () const noexcept
 

Private Types

using map_type = detail::flat_map< osmium::unsigned_object_id_type, uint32_t, osmium::unsigned_object_id_type, uint32_t >
 

Private Member Functions

 RelationsMapIndex (map_type &&map)
 

Private Attributes

map_type m_map
 

Friends

class RelationsMapStash
 

Detailed Description

Index for looking up parent relation IDs given a member relation ID. You can not instantiate such an index yourself, instead you need to instantiate a RelationsMapStash, fill it and then create an index from it:

...
for_each_relation(const osmium::Relation& relation) {
stash.add_members(relation);
}
...
const auto index = stash.build_index();
...
osmium::unsigned_object_id_type member_id = ...;
index.for_each_parent(member_id, [](osmium::unsigned_object_id_type id) {
...
});
...

Member Typedef Documentation

◆ map_type

Constructor & Destructor Documentation

◆ RelationsMapIndex() [1/4]

osmium::index::RelationsMapIndex::RelationsMapIndex ( map_type &&  map)
inlineprivate

◆ RelationsMapIndex() [2/4]

osmium::index::RelationsMapIndex::RelationsMapIndex ( )
delete

◆ RelationsMapIndex() [3/4]

osmium::index::RelationsMapIndex::RelationsMapIndex ( const RelationsMapIndex )
delete

◆ RelationsMapIndex() [4/4]

osmium::index::RelationsMapIndex::RelationsMapIndex ( RelationsMapIndex &&  )
default

Member Function Documentation

◆ empty()

bool osmium::index::RelationsMapIndex::empty ( ) const
inlinenoexcept

Is this index empty?

Complexity: Constant.

◆ for_each_parent()

template<typename Func >
void osmium::index::RelationsMapIndex::for_each_parent ( osmium::unsigned_object_id_type  member_id,
Func &&  func 
) const
inline

Find the given relation id in the index and call the given function with all parent relation ids.

index.for_each_parent(member_id, [](osmium::unsigned_object_id_type id) {
...
});

Complexity: Logarithmic in the number of elements in the index. (Lookup uses binary search.)

◆ operator=() [1/2]

RelationsMapIndex& osmium::index::RelationsMapIndex::operator= ( const RelationsMapIndex )
delete

◆ operator=() [2/2]

RelationsMapIndex& osmium::index::RelationsMapIndex::operator= ( RelationsMapIndex &&  )
default

◆ size()

size_t osmium::index::RelationsMapIndex::size ( ) const
inlinenoexcept

How many entries are in this index?

Complexity: Constant.

Friends And Related Function Documentation

◆ RelationsMapStash

friend class RelationsMapStash
friend

Member Data Documentation

◆ m_map

map_type osmium::index::RelationsMapIndex::m_map
private

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