Libosmium
2.11.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <id_set.hpp>
Public Types | |
using | const_iterator = typename std::vector< T >::const_iterator |
Iterator type. There is no non-const iterator. More... | |
Public Member Functions | |
void | set (T id) overridefinal |
bool | get (T id) const noexceptoverridefinal |
bool | get_binary_search (T id) const noexcept |
bool | empty () const noexceptoverridefinal |
void | clear () overridefinal |
void | sort_unique () |
size_t | size () const noexcept |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
![]() | |
virtual | ~IdSet () |
Private Attributes | |
std::vector< T > | m_data |
IdSet implementation for small Id sets. It writes the Ids into a vector and uses linear search.
using osmium::index::IdSetSmall< T >::const_iterator = typename std::vector<T>::const_iterator |
Iterator type. There is no non-const iterator.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinefinaloverridevirtual |
Clear the set.
Implements osmium::index::IdSet< T >.
|
inlinefinaloverridevirtualnoexcept |
Is the set empty?
Implements osmium::index::IdSet< T >.
|
inlinenoexcept |
|
inlinefinaloverridevirtualnoexcept |
Is the Id in the set? Uses linear search.
id | The Id to check. |
Implements osmium::index::IdSet< T >.
|
inlinenoexcept |
Is the Id in the set? Uses a binary search. For larger sets this might be more efficient than calling get(), the set must be sorted.
id | The Id to check. |
|
inlinefinaloverridevirtual |
Add the given Id to the set.
Implements osmium::index::IdSet< T >.
|
inlinenoexcept |
The number of Ids stored in the set.
|
inline |
Sort the internal vector and remove any duplicates. Call this before using size(), get_binary_search() or using an iterator.
|
private |