Libosmium
2.2.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <sparse_mem_multimap.hpp>
Public Types | |
typedef std::multimap< const TId, TValue > | collection_type |
typedef collection_type::iterator | iterator |
typedef collection_type::const_iterator | const_iterator |
typedef collection_type::value_type | value_type |
typedef std::pair< TId, TValue > | element_type |
![]() | |
typedef TId | key_type |
The "key" type, usually osmium::unsigned_object_id_type. More... | |
typedef TValue | value_type |
The "value" type, usually a Location or size_t. More... | |
typedef element_type * | iterator |
Public Member Functions | |
SparseMemMultimap ()=default | |
~SparseMemMultimap () noexceptoverridefinal=default | |
void | unsorted_set (const TId id, const TValue value) |
void | set (const TId id, const TValue value) overridefinal |
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 overridefinal |
size_t | used_memory () const overridefinal |
void | clear () overridefinal |
void | consolidate () |
void | dump_as_list (const int fd) overridefinal |
![]() | |
Multimap ()=default | |
virtual | ~Multimap () noexcept=default |
virtual void | sort () |
Private Attributes | |
collection_type | m_elements |
Static Private Attributes | |
static constexpr size_t | element_size = sizeof(TId) + sizeof(TValue) + sizeof(void*) * 4 |
Additional Inherited Members | |
![]() | |
Multimap (Multimap &&)=default | |
Multimap & | operator= (Multimap &&)=default |
This implementation uses std::multimap internally. It uses rather a lot of memory, but might make sense for small maps.
typedef std::multimap<const TId, TValue> osmium::index::multimap::SparseMemMultimap< TId, TValue >::collection_type |
typedef collection_type::const_iterator osmium::index::multimap::SparseMemMultimap< TId, TValue >::const_iterator |
typedef std::pair<TId, TValue> osmium::index::multimap::SparseMemMultimap< TId, TValue >::element_type |
typedef collection_type::iterator osmium::index::multimap::SparseMemMultimap< TId, TValue >::iterator |
typedef collection_type::value_type osmium::index::multimap::SparseMemMultimap< TId, TValue >::value_type |
|
default |
|
finaloverridedefaultnoexcept |
|
inline |
|
inlinefinaloverridevirtual |
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 |
|
inlinefinaloverridevirtual |
Reimplemented from osmium::index::multimap::Multimap< TId, TValue >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinefinaloverridevirtual |
Set the field with id to value.
Implements osmium::index::multimap::Multimap< TId, TValue >.
|
inlinefinaloverridevirtual |
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 |
|
inlinefinaloverridevirtual |
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 >.
|
staticprivate |
|
private |