Loading...
Searching...
No Matches
osmium::relations::RelationHandle Class Reference

`#include <relations_database.hpp>`

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

## Public Member Functions

RelationsDatabase * | relation_database () const noexcept
std::size_t | pos () const noexcept
Relation & | operator* ()
const Relation & | operator* () const
Relation * | operator-> ()
const Relation * | operator-> () 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

RelationsDatabase * | m_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
| ) |  |

inline private

## Member Function Documentation

## decrement_members()

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

inline noexcept

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

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

## has_all_members()

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

inline noexcept

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

## increment_members()

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

inline noexcept

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

inline noexcept

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];
osmium::relations::RelationHandle::pos
std::size_t pos() const noexcept
Definition relations_database.hpp:238

## relation_database()

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

inline noexcept

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

inline noexcept

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

## Friends And Related Symbol 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:

- include/osmium/relations/relations_database.hpp