Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <id_set.hpp>
Public Types | |
using | const_iterator = IdSetDenseIterator< T, chunk_bits > |
Public Member Functions | |
IdSetDense ()=default | |
IdSetDense (const IdSetDense &other) | |
IdSetDense & | operator= (IdSetDense other) |
IdSetDense (IdSetDense &&) noexcept=default | |
IdSetDense & | operator= (IdSetDense &&)=default |
~IdSetDense () noexcept override=default | |
bool | check_and_set (T id) |
void | set (T id) final |
void | unset (T id) |
bool | get (T id) const noexcept final |
bool | empty () const noexcept final |
T | size () const noexcept |
void | clear () final |
std::size_t | used_memory () const noexcept final |
const_iterator | begin () const |
const_iterator | end () const |
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 Types | |
enum | : std::size_t { chunk_size = 1U << chunk_bits } |
Private Member Functions | |
T | last () const noexcept |
unsigned char & | get_element (T id) |
Static Private Member Functions | |
static std::size_t | chunk_id (T id) noexcept |
static std::size_t | offset (T id) noexcept |
static unsigned int | bitmask (T id) noexcept |
Private Attributes | |
std::vector< std::unique_ptr< unsigned char[]> > | m_data |
T | m_size = 0 |
Friends | |
class | IdSetDenseIterator< T, chunk_bits > |
void | swap (IdSetDense &first, IdSetDense &second) noexcept |
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, chunk_bits >::const_iterator = IdSetDenseIterator<T, chunk_bits> |
|
private |
|
default |
|
inline |
|
defaultnoexcept |
|
overridedefaultnoexcept |
|
inline |
|
inlinestaticprivatenoexcept |
|
inline |
Add the Id to the set if it is not already in there.
id | The Id to set. |
|
inlinestaticprivatenoexcept |
|
inlinefinalvirtual |
Clear the set.
Implements osmium::index::IdSet< T >.
|
inlinefinalvirtualnoexcept |
Is the set empty?
Implements osmium::index::IdSet< T >.
|
inline |
|
inlinefinalvirtualnoexcept |
|
inlineprivate |
|
inlineprivatenoexcept |
|
inlinestaticprivatenoexcept |
|
default |
|
inline |
|
inlinefinalvirtual |
|
inlinenoexcept |
The number of Ids stored in the set.
|
inline |
Remove the given Id from the set.
id | The Id to set. |
|
inlinefinalvirtualnoexcept |
Get an estimate of the amount of memory used for the set.
Implements osmium::index::IdSet< T >.
|
friend |
|
friend |
|
private |
|
private |