Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <sparse_mem_multimap.hpp>
Public Types | |
using | collection_type = typename std::multimap< const TId, TValue > |
using | iterator = typename collection_type::iterator |
using | const_iterator = typename collection_type::const_iterator |
using | value_type = typename collection_type::value_type |
using | element_type = typename std::pair< TId, TValue > |
Public Types inherited from osmium::index::multimap::Multimap< TId, TValue > | |
using | key_type = TId |
The "key" type, usually osmium::unsigned_object_id_type. More... | |
using | value_type = TValue |
The "value" type, usually a Location or size_t. More... | |
using | iterator = element_type * |
Public Member Functions | |
SparseMemMultimap ()=default | |
~SparseMemMultimap () noexcept=default | |
void | unsorted_set (const TId id, const TValue value) |
void | set (const TId id, const TValue value) override |
Set the field with id to value. More... | |
std::pair< iterator, iterator > | get_all (const TId id) |
std::pair< const_iterator, const_iterator > | get_all (const TId id) const |
void | remove (const TId id, const TValue value) |
iterator | begin () |
iterator | end () |
size_t | size () const override |
size_t | used_memory () const override |
void | clear () override |
void | consolidate () |
void | dump_as_list (const int fd) override |
Public Member Functions inherited from osmium::index::multimap::Multimap< TId, TValue > | |
Multimap ()=default | |
Multimap (const Multimap &)=delete | |
Multimap & | operator= (const Multimap &)=delete |
virtual | ~Multimap () noexcept=default |
virtual void | set (const TId id, const TValue value)=0 |
Set the field with id to value. More... | |
virtual size_t | size () const =0 |
virtual size_t | used_memory () const =0 |
virtual void | clear ()=0 |
virtual void | sort () |
virtual void | dump_as_list (const int) |
Private Types | |
enum | { element_size = sizeof(TId) + sizeof(TValue) + sizeof(void*) * 4U } |
Private Attributes | |
collection_type | m_elements |
Additional Inherited Members | |
Protected Member Functions inherited from osmium::index::multimap::Multimap< TId, TValue > | |
Multimap (Multimap &&) noexcept=default | |
Multimap & | operator= (Multimap &&) noexcept=default |
This implementation uses std::multimap internally. It uses rather a lot of memory, but might make sense for small maps.
using osmium::index::multimap::SparseMemMultimap< TId, TValue >::collection_type = typename std::multimap<const TId, TValue> |
using osmium::index::multimap::SparseMemMultimap< TId, TValue >::const_iterator = typename collection_type::const_iterator |
using osmium::index::multimap::SparseMemMultimap< TId, TValue >::element_type = typename std::pair<TId, TValue> |
using osmium::index::multimap::SparseMemMultimap< TId, TValue >::iterator = typename collection_type::iterator |
using osmium::index::multimap::SparseMemMultimap< TId, TValue >::value_type = typename collection_type::value_type |
|
default |
|
defaultnoexcept |
|
inline |
|
inlineoverridevirtual |
Clear memory used for this storage. After this you can not use the storage container any more.
Implements osmium::index::multimap::Multimap< TId, TValue >.
|
inline |
|
inlineoverridevirtual |
Reimplemented from osmium::index::multimap::Multimap< TId, TValue >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Set the field with id to value.
Implements osmium::index::multimap::Multimap< TId, TValue >.
|
inlineoverridevirtual |
Get the approximate number of items in the storage. The storage might allocate memory in blocks, so this size might not be accurate. You can not use this to find out how much memory the storage uses. Use used_memory() for that.
Implements osmium::index::multimap::Multimap< TId, TValue >.
|
inline |
|
inlineoverridevirtual |
Get the memory used for this storage in bytes. Note that this is not necessarily entirely accurate but an approximation. For storage classes that store the data in memory, this is the main memory used, for storage classes storing data on disk this is the memory used on disk.
Implements osmium::index::multimap::Multimap< TId, TValue >.
|
private |