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

#include <dummy.hpp>

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

Public Member Functions

 Dummy ()=default
 
 Dummy (const Dummy &)=default
 
Dummyoperator= (const Dummy &)=default
 
 Dummy (Dummy &&) noexcept=default
 
Dummyoperator= (Dummy &&) noexcept=default
 
 ~Dummy () noexcept override=default
 
void set (const TId, const TValue) final
 Set the field with id to value. More...
 
TValue get (const TId id) const final
 
TValue get_noexcept (const TId) const noexcept final
 
size_t size () const final
 
size_t used_memory () const final
 
void clear () final
 
- Public Member Functions inherited from osmium::index::map::Map< TId, TValue >
 Map () noexcept=default
 
 Map (const Map &)=delete
 
Mapoperator= (const Map &)=delete
 
virtual ~Map () noexcept=default
 
virtual void reserve (const std::size_t)
 
virtual void set (const TId id, const TValue value)=0
 Set the field with id to value. More...
 
virtual TValue get (const TId id) const =0
 
virtual TValue get_noexcept (const TId id) const noexcept=0
 
virtual std::size_t size () const =0
 
virtual std::size_t used_memory () const =0
 
virtual void clear ()=0
 
virtual void sort ()
 
virtual void dump_as_list (const int)
 
virtual void dump_as_array (const int)
 

Additional Inherited Members

- Public Types inherited from osmium::index::map::Map< 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...
 
- Protected Member Functions inherited from osmium::index::map::Map< TId, TValue >
 Map (Map &&) noexcept=default
 
Mapoperator= (Map &&) noexcept=default
 

Detailed Description

template<typename TId, typename TValue>
class osmium::index::map::Dummy< TId, TValue >

Pseudo map. Use this class if you don't need a map, but you need an object that behaves like one.

Constructor & Destructor Documentation

◆ Dummy() [1/3]

template<typename TId , typename TValue >
osmium::index::map::Dummy< TId, TValue >::Dummy ( )
default

◆ Dummy() [2/3]

template<typename TId , typename TValue >
osmium::index::map::Dummy< TId, TValue >::Dummy ( const Dummy< TId, TValue > &  )
default

◆ Dummy() [3/3]

template<typename TId , typename TValue >
osmium::index::map::Dummy< TId, TValue >::Dummy ( Dummy< TId, TValue > &&  )
defaultnoexcept

◆ ~Dummy()

template<typename TId , typename TValue >
osmium::index::map::Dummy< TId, TValue >::~Dummy ( )
overridedefaultnoexcept

Member Function Documentation

◆ clear()

template<typename TId , typename TValue >
void osmium::index::map::Dummy< TId, TValue >::clear ( )
inlinefinalvirtual

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

Implements osmium::index::map::Map< TId, TValue >.

◆ get()

template<typename TId , typename TValue >
TValue osmium::index::map::Dummy< TId, TValue >::get ( const TId  id) const
inlinefinalvirtual

Retrieve value by id.

Parameters
idThe id to look for.
Returns
Value.
Exceptions
osmium::not_foundif the id could not be found.

Implements osmium::index::map::Map< TId, TValue >.

◆ get_noexcept()

template<typename TId , typename TValue >
TValue osmium::index::map::Dummy< TId, TValue >::get_noexcept ( const  id) const
inlinefinalvirtualnoexcept

Retrieve value by id.

Parameters
idThe id to look for.
Returns
Value or, if not found, the empty value as defined by osmium::index::empty_value<TValue>() which is usually the default constructed value of type TValue.

Implements osmium::index::map::Map< TId, TValue >.

◆ operator=() [1/2]

template<typename TId , typename TValue >
Dummy & osmium::index::map::Dummy< TId, TValue >::operator= ( const Dummy< TId, TValue > &  )
default

◆ operator=() [2/2]

template<typename TId , typename TValue >
Dummy & osmium::index::map::Dummy< TId, TValue >::operator= ( Dummy< TId, TValue > &&  )
defaultnoexcept

◆ set()

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

Set the field with id to value.

Implements osmium::index::map::Map< TId, TValue >.

◆ size()

template<typename TId , typename TValue >
size_t osmium::index::map::Dummy< 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::map::Map< TId, TValue >.

◆ used_memory()

template<typename TId , typename TValue >
size_t osmium::index::map::Dummy< 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::map::Map< TId, TValue >.


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