Libosmium  2.5.4
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

typedef HybridIterator< TId, TValue > iterator
 
typedef const HybridIterator< TId, TValue > const_iterator
 
- Public Types inherited from osmium::index::multimap::Multimap< TId, TValue >
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_typeiterator
 

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
 
virtual ~Multimap () noexcept=default
 

Private Types

typedef SparseMemArray< TId, TValue > main_map_type
 
typedef SparseMemMultimap< TId, TValue > extra_map_type
 

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 &&)=default
 
Multimapoperator= (Multimap &&)=default
 

Member Typedef Documentation

template<typename TId , typename TValue >
typedef const HybridIterator<TId, TValue> osmium::index::multimap::Hybrid< TId, TValue >::const_iterator
template<typename TId , typename TValue >
typedef SparseMemMultimap<TId, TValue> osmium::index::multimap::Hybrid< TId, TValue >::extra_map_type
private
template<typename TId , typename TValue >
typedef HybridIterator<TId, TValue> osmium::index::multimap::Hybrid< TId, TValue >::iterator
template<typename TId , typename TValue >
typedef SparseMemArray<TId, TValue> osmium::index::multimap::Hybrid< TId, TValue >::main_map_type
private

Constructor & Destructor Documentation

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

Member Function Documentation

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

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::consolidate ( )
inline
template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::dump_as_list ( const int  fd)
inlinefinalvirtual
template<typename TId , typename TValue >
std::pair<iterator, iterator> osmium::index::multimap::Hybrid< TId, TValue >::get_all ( const TId  id)
inline
template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::remove ( const TId  id,
const TValue  value 
)
inline
template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::reserve ( const size_t  size)
inline
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 >.

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

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

template<typename TId , typename TValue >
void osmium::index::multimap::Hybrid< TId, TValue >::unsorted_set ( const TId  id,
const TValue  value 
)
inline
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

template<typename TId , typename TValue >
extra_map_type osmium::index::multimap::Hybrid< TId, TValue >::m_extra
private
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: