Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
osmium::index::multimap::Hybrid< TId, TValue > Class Template Reference

#include <hybrid.hpp>

Inheritance diagram for osmium::index::multimap::Hybrid< TId, TValue >:
Inheritance graph
[legend]
Collaboration diagram for osmium::index::multimap::Hybrid< TId, TValue >:
Collaboration graph
[legend]

Public Types

using iterator = HybridIterator< TId, TValue >
 
using const_iterator = const HybridIterator< 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

 Hybrid ()
 
 ~Hybrid () noexcept=default
 
size_t size () const final
 
size_t used_memory () const final
 
void reserve (const size_t size)
 
void unsorted_set (const TId id, const TValue value)
 
void set (const TId id, const TValue value) final
 Set the field with id to value. More...
 
std::pair< iterator, iteratorget_all (const TId id)
 
void remove (const TId id, const TValue value)
 
void consolidate ()
 
void dump_as_list (const int fd) final
 
void clear () final
 
void sort () final
 
- Public Member Functions inherited from osmium::index::multimap::Multimap< TId, TValue >
 Multimap ()=default
 
 Multimap (const Multimap &)=delete
 
Multimapoperator= (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

using main_map_type = SparseMemArray< TId, TValue >
 
using extra_map_type = SparseMemMultimap< TId, TValue >
 

Private Attributes

main_map_type m_main
 
extra_map_type m_extra
 

Additional Inherited Members

- Protected Member Functions inherited from osmium::index::multimap::Multimap< TId, TValue >
 Multimap (Multimap &&) noexcept=default
 
Multimapoperator= (Multimap &&) noexcept=default
 

Member Typedef Documentation

◆ const_iterator

template<typename TId , typename TValue >
using osmium::index::multimap::Hybrid< TId, TValue >::const_iterator = const HybridIterator<TId, TValue>

◆ extra_map_type

template<typename TId , typename TValue >
using osmium::index::multimap::Hybrid< TId, TValue >::extra_map_type = SparseMemMultimap<TId, TValue>
private

◆ iterator

template<typename TId , typename TValue >
using osmium::index::multimap::Hybrid< TId, TValue >::iterator = HybridIterator<TId, TValue>

◆ main_map_type

template<typename TId , typename TValue >
using osmium::index::multimap::Hybrid< TId, TValue >::main_map_type = SparseMemArray<TId, TValue>
private

Constructor & Destructor Documentation

◆ Hybrid()

template<typename TId , typename TValue >
osmium::index::multimap::Hybrid< TId, TValue >::Hybrid ( )
inline

◆ ~Hybrid()

template<typename TId , typename TValue >
osmium::index::multimap::Hybrid< TId, TValue >::~Hybrid ( )
defaultnoexcept

Member Function Documentation

◆ clear()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::clear ( )
inlinefinalvirtual

Clear memory used for this storage. After this you can not use the storage container any more.

Implements osmium::index::multimap::Multimap< TId, TValue >.

◆ consolidate()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::consolidate ( )
inline

◆ dump_as_list()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::dump_as_list ( const int  fd)
inlinefinalvirtual

◆ get_all()

template<typename TId , typename TValue >
std::pair< iterator, iterator > osmium::index::multimap::Hybrid< TId, TValue >::get_all ( const TId  id)
inline

◆ remove()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::remove ( const TId  id,
const TValue  value 
)
inline

◆ reserve()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::reserve ( const size_t  size)
inline

◆ set()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::set ( const TId  id,
const TValue  value 
)
inlinefinalvirtual

Set the field with id to value.

Implements osmium::index::multimap::Multimap< TId, TValue >.

◆ size()

template<typename TId , typename TValue >
size_t osmium::index::multimap::Hybrid< TId, TValue >::size ( ) const
inlinefinalvirtual

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 >.

◆ sort()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::sort ( )
inlinefinalvirtual

Sort data in map. Call this after writing all data and before reading. Not all implementations need this.

Reimplemented from osmium::index::multimap::Multimap< TId, TValue >.

◆ unsorted_set()

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::unsorted_set ( const TId  id,
const TValue  value 
)
inline

◆ used_memory()

template<typename TId , typename TValue >
size_t osmium::index::multimap::Hybrid< TId, TValue >::used_memory ( ) const
inlinefinalvirtual

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 >.

Member Data Documentation

◆ m_extra

template<typename TId , typename TValue >
extra_map_type osmium::index::multimap::Hybrid< TId, TValue >::m_extra
private

◆ m_main

template<typename TId , typename TValue >
main_map_type osmium::index::multimap::Hybrid< TId, TValue >::m_main
private

The documentation for this class was generated from the following file: