1#ifndef OSMIUM_INDEX_MULTIMAP_HYBRID_HPP
2#define OSMIUM_INDEX_MULTIMAP_HYBRID_HPP
50 template <
typename TId,
typename TValue>
66 typename main_map_type::iterator end_main,
90 const auto tmp{*
this};
119 template <
typename TId,
typename TValue>
156 void set(
const TId
id,
const TValue value)
final {
160 std::pair<iterator, iterator>
get_all(
const TId
id) {
161 const auto result_main =
m_main.get_all(
id);
163 return std::make_pair(
iterator{result_main.first, result_main.second, result_extra.first, result_extra.second},
164 iterator{result_main.second, result_main.second, result_extra.second, result_extra.second});
167 void remove(
const TId
id,
const TValue value) {
174 for (
const auto& element :
m_extra) {
175 m_main.set(element.first, element.second);
Definition: hybrid.hpp:51
main_map_type::iterator m_begin_main
Definition: hybrid.hpp:58
const element_type & operator*()
Definition: hybrid.hpp:106
SparseMemArray< TId, TValue > main_map_type
Definition: hybrid.hpp:53
typename std::pair< TId, TValue > element_type
Definition: hybrid.hpp:56
bool operator==(const HybridIterator &rhs) const
Definition: hybrid.hpp:95
HybridIterator(typename main_map_type::iterator begin_main, typename main_map_type::iterator end_main, typename extra_map_type::iterator begin_extra, typename extra_map_type::iterator end_extra)
Definition: hybrid.hpp:65
HybridIterator< TId, TValue > operator++(int)
Definition: hybrid.hpp:89
extra_map_type::iterator m_begin_extra
Definition: hybrid.hpp:60
bool operator!=(const HybridIterator &rhs) const
Definition: hybrid.hpp:102
HybridIterator & operator++()
Definition: hybrid.hpp:77
~HybridIterator() noexcept=default
extra_map_type::iterator m_end_extra
Definition: hybrid.hpp:61
const element_type * operator->()
Definition: hybrid.hpp:113
main_map_type::iterator m_end_main
Definition: hybrid.hpp:59
Definition: hybrid.hpp:120
void reserve(const size_t size)
Definition: hybrid.hpp:148
size_t used_memory() const final
Definition: hybrid.hpp:144
void sort() final
Definition: hybrid.hpp:191
SparseMemArray< TId, TValue > main_map_type
Definition: hybrid.hpp:122
extra_map_type m_extra
Definition: hybrid.hpp:126
void consolidate()
Definition: hybrid.hpp:172
void unsorted_set(const TId id, const TValue value)
Definition: hybrid.hpp:152
void clear() final
Definition: hybrid.hpp:186
Hybrid()
Definition: hybrid.hpp:133
main_map_type m_main
Definition: hybrid.hpp:125
size_t size() const final
Definition: hybrid.hpp:140
void set(const TId id, const TValue value) final
Set the field with id to value.
Definition: hybrid.hpp:156
std::pair< iterator, iterator > get_all(const TId id)
Definition: hybrid.hpp:160
void dump_as_list(const int fd) final
Definition: hybrid.hpp:181
~Hybrid() noexcept=default
void remove(const TId id, const TValue value)
Definition: hybrid.hpp:167
Definition: multimap.hpp:51
element_type * iterator
Definition: multimap.hpp:79
Definition: sparse_mem_multimap.hpp:56
size_t used_memory() const override
Definition: sparse_mem_multimap.hpp:122
void remove(const TId id, const TValue value)
Definition: sparse_mem_multimap.hpp:100
size_t size() const override
Definition: sparse_mem_multimap.hpp:118
typename collection_type::iterator iterator
Definition: sparse_mem_multimap.hpp:69
void set(const TId id, const TValue value) override
Set the field with id to value.
Definition: sparse_mem_multimap.hpp:88
std::pair< iterator, iterator > get_all(const TId id)
Definition: sparse_mem_multimap.hpp:92
void clear() override
Definition: sparse_mem_multimap.hpp:126
VectorBasedSparseMultimap< TId, TValue, StdVectorWrap > SparseMemArray
Definition: sparse_mem_array.hpp:50
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53