Libosmium
2.20.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 | |
IdSetSmall ()=default | |
IdSetSmall (const IdSetSmall &)=default | |
IdSetSmall & | operator= (const IdSetSmall &)=default |
IdSetSmall (IdSetSmall &&) noexcept=default | |
IdSetSmall & | operator= (IdSetSmall &&) noexcept=default |
~IdSetSmall () noexcept override=default | |
void | set (T id) final |
bool | get (T id) const noexcept final |
bool | get_binary_search (T id) const noexcept |
bool | empty () const noexcept final |
void | clear () final |
void | sort_unique () |
std::size_t | size () const noexcept |
std::size_t | used_memory () const noexcept final |
void | merge_sorted (const IdSetSmall< T > &other) |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
Public Member Functions inherited from osmium::index::IdSet< T > | |
IdSet ()=default | |
IdSet (const IdSet &)=default | |
IdSet & | operator= (const IdSet &)=default |
IdSet (IdSet &&) noexcept=default | |
IdSet & | operator= (IdSet &&) noexcept=default |
virtual | ~IdSet () noexcept=default |
virtual void | set (T id)=0 |
virtual bool | get (T id) const noexcept=0 |
virtual bool | empty () const =0 |
virtual void | clear ()=0 |
virtual std::size_t | used_memory () const noexcept=0 |
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.
|
default |
|
default |
|
defaultnoexcept |
|
overridedefaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinefinalvirtual |
Clear the set.
Implements osmium::index::IdSet< T >.
|
inlinefinalvirtualnoexcept |
Is the set empty?
Implements osmium::index::IdSet< T >.
|
inlinenoexcept |
|
inlinefinalvirtualnoexcept |
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. |
|
inline |
Merge the other set into this one. The result is sorted.
|
default |
|
defaultnoexcept |
|
inlinefinalvirtual |
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(), merge_sorted() or using an iterator.
|
inlinefinalvirtualnoexcept |
Get an estimate of the amount of memory used for the set.
Implements osmium::index::IdSet< T >.
|
private |