Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
osmium::relations::RelationHandle Class Reference

#include <relations_database.hpp>

Collaboration diagram for osmium::relations::RelationHandle:
Collaboration graph
[legend]

Public Member Functions

RelationsDatabaserelation_database () const noexcept
 
std::size_t pos () const noexcept
 
Relationoperator* ()
 
const Relationoperator* () const
 
Relationoperator-> ()
 
const Relationoperator-> () const
 
void remove ()
 
void set_members (std::size_t value) noexcept
 
void increment_members () noexcept
 
void decrement_members () noexcept
 
bool has_all_members () const noexcept
 

Private Member Functions

 RelationHandle (RelationsDatabase *relation_database, std::size_t pos)
 

Private Attributes

RelationsDatabasem_relation_database
 
std::size_t m_pos
 

Friends

class RelationsDatabase
 

Detailed Description

A RelationHandle is used to access elements in a RelationsDatabase.

RelationHandles can not be created by user code, they are only given out by a RelationsDatabase object.

Constructor & Destructor Documentation

◆ RelationHandle()

osmium::relations::RelationHandle::RelationHandle ( RelationsDatabase relation_database,
std::size_t  pos 
)
inlineprivate

Member Function Documentation

◆ decrement_members()

void osmium::relations::RelationHandle::decrement_members ( )
inlinenoexcept

Decrement the number of relation members that we want to track.

Precondition
has_all_members() == false
bool has_all_members() const noexcept
Definition: relations_database.hpp:306

◆ has_all_members()

bool osmium::relations::RelationHandle::has_all_members ( ) const
inlinenoexcept

Do we have all members? This is true if the number of tracked members is zero.

◆ increment_members()

void osmium::relations::RelationHandle::increment_members ( )
inlinenoexcept

Increment the number of relation members that we want to track.

◆ operator*() [1/2]

Relation & osmium::relations::RelationHandle::operator* ( )
inline

Access the relation stored in the database.

◆ operator*() [2/2]

const Relation & osmium::relations::RelationHandle::operator* ( ) const
inline

Access the relation stored in the database.

◆ operator->() [1/2]

Relation * osmium::relations::RelationHandle::operator-> ( )
inline

Call a function on the relation stored in the database.

◆ operator->() [2/2]

const Relation * osmium::relations::RelationHandle::operator-> ( ) const
inline

Call a function on the relation stored in the database.

◆ pos()

std::size_t osmium::relations::RelationHandle::pos ( ) const
inlinenoexcept

The position of the element in the RelationsDatabase. Use the RelationsDatabase::operator[] to get the handle back from this position:

auto pos = handle.pos();
auto second_handle = relation_db[pos];
std::size_t pos() const noexcept
Definition: relations_database.hpp:238

◆ relation_database()

RelationsDatabase * osmium::relations::RelationHandle::relation_database ( ) const
inlinenoexcept

The RelationsDatabase this handle refers to.

◆ remove()

void osmium::relations::RelationHandle::remove ( )
inline

Remove the relation referred to by this handle from the database. All handles referring to this database element become invalid.

◆ set_members()

void osmium::relations::RelationHandle::set_members ( std::size_t  value)
inlinenoexcept

Set the number of relation members that we want to track.

Friends And Related Function Documentation

◆ RelationsDatabase

friend class RelationsDatabase
friend

Member Data Documentation

◆ m_pos

std::size_t osmium::relations::RelationHandle::m_pos
private

◆ m_relation_database

RelationsDatabase* osmium::relations::RelationHandle::m_relation_database
private

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