Libosmium
2.10.3
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <id_set.hpp>
Public Types | |
using | const_iterator = IdSetDenseIterator< T > |
Public Member Functions | |
IdSetDense ()=default | |
bool | check_and_set (T id) |
void | set (T id) overridefinal |
void | unset (T id) |
bool | get (T id) const noexceptoverridefinal |
bool | empty () const noexceptoverridefinal |
T | size () const noexcept |
void | clear () overridefinal |
IdSetDenseIterator< T > | begin () const |
IdSetDenseIterator< T > | end () const |
![]() | |
virtual | ~IdSet () |
Private Member Functions | |
T | last () const noexcept |
unsigned char & | get_element (T id) |
Static Private Member Functions | |
static size_t | chunk_id (T id) noexcept |
static size_t | offset (T id) noexcept |
static unsigned char | bitmask (T id) noexcept |
Private Attributes | |
std::vector< std::unique_ptr < unsigned char[]> > | m_data |
T | m_size = 0 |
Static Private Attributes | |
static constexpr const size_t | chunk_bits = 22 |
static constexpr const size_t | chunk_size = 1 << chunk_bits |
Friends | |
class | IdSetDenseIterator< T > |
A set of Ids of the given type. Internal storage is in chunks of arrays used as bit fields. Internally those chunks will be allocated as needed, so it works relatively efficiently with both smaller and larger Id sets. If it is not used, no memory is allocated at all.
using osmium::index::IdSetDense< T >::const_iterator = IdSetDenseIterator<T> |
|
default |
|
inline |
|
inlinestaticprivatenoexcept |
|
inline |
Add the Id to the set if it is not already in there.
id | The Id to set. |
|
inlinestaticprivatenoexcept |
|
inlinefinaloverridevirtual |
Clear the set.
Implements osmium::index::IdSet< T >.
|
inlinefinaloverridevirtualnoexcept |
Is the set empty?
Implements osmium::index::IdSet< T >.
|
inline |
|
inlinefinaloverridevirtualnoexcept |
|
inlineprivate |
|
inlineprivatenoexcept |
|
inlinestaticprivatenoexcept |
|
inlinefinaloverridevirtual |
|
inlinenoexcept |
The number of Ids stored in the set.
|
inline |
Remove the given Id from the set.
id | The Id to set. |
|
friend |
|
staticprivate |
|
staticprivate |
|
private |
|
private |