Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <members_database.hpp>
Classes | |
struct | compare_member_id |
struct | counts |
struct | element |
Public Member Functions | |
std::size_t | used_memory () const noexcept |
std::size_t | size () const noexcept |
counts | count () const noexcept |
void | track (RelationHandle &rel_handle, osmium::object_id_type member_id, std::size_t member_num) |
void | prepare_for_lookup () |
void | remove (osmium::object_id_type member_id, osmium::object_id_type relation_id) |
const osmium::OSMObject * | get_object (osmium::object_id_type id) const |
Protected Types | |
using | iterator = std::vector< element >::iterator |
using | const_iterator = std::vector< element >::const_iterator |
Protected Member Functions | |
iterator_range< iterator > | find (osmium::object_id_type id) |
iterator_range< const_iterator > | find (osmium::object_id_type id) const |
void | add_object (const osmium::OSMObject &object, iterator_range< iterator > &range) |
MembersDatabaseCommon (osmium::ItemStash &stash, osmium::relations::RelationsDatabase &relations_db) | |
Static Protected Member Functions | |
static std::iterator_traits< iterator >::difference_type | count_not_removed (const iterator_range< iterator > &range) noexcept |
Protected Attributes | |
osmium::ItemStash & | m_stash |
osmium::relations::RelationsDatabase & | m_relations_db |
bool | m_init_phase = true |
Private Attributes | |
std::vector< element > | m_elements {} |
This is the parent class for the MembersDatabase class. All the functionality which doesn't depend on the template parameter used in derived databases is contained in this class.
Usually you want to use the MembersDatabase class only.
|
protected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
inlinenoexcept |
Counts the number of members in different states. Usually only used for testing and debugging.
Complexity: Linear in the number of members tracked.
|
inlinestaticprotectednoexcept |
|
inlineprotected |
|
inlineprotected |
|
inline |
Find the object with the specified id in the database and return a pointer to it. Returns nullptr if there is no object with that id in the database.
Complexity: Logarithmic in the number of members tracked (as returned by size()).
|
inline |
Prepare the database for lookup. Call this function after calling track() for all objects needed and before adding the first object with add() or querying the first object with get(). You can only call this function once.
|
inline |
Remove the entry with the specified member_id and relation_id from the database. If the entry doesn't exist, nothing happens.
|
inlinenoexcept |
The number of members tracked in the database. Includes members tracked, but not found yet, members found and members marked as removed.
Complexity: Constant.
|
inline |
Tell the database that you are interested in an object with the specified id and that it is a member of the given relation (as specified through the relation handle).
rel_handle | Relation this object is a member of. |
member_id | Id of an object of type TObject. |
member_num | This is the nth member in the relation. |
|
inlinenoexcept |
Return an estimate of the number of bytes currently needed for the MembersDatabase. This does NOT include the memory used in the stash. Used for debugging.
|
private |
|
protected |
|
protected |
|
protected |