1 #ifndef OSMIUM_INDEX_MAP_SPARSE_MEM_MAP_HPP 2 #define OSMIUM_INDEX_MAP_SPARSE_MEM_MAP_HPP 38 #include <osmium/io/detail/read_write.hpp> 46 #define OSMIUM_HAS_INDEX_MAP_SPARSE_MEM_MAP 58 template <
typename TId,
typename TValue>
75 void set(
const TId
id,
const TValue value)
final {
79 TValue
get(
const TId
id)
const final {
90 return osmium::index::empty_value<TValue>();
95 size_t size() const noexcept final {
108 using t =
typename std::map<TId, TValue>::value_type;
112 osmium::io::detail::reliable_write(fd, reinterpret_cast<const char*>(v.data()),
sizeof(t) * v.size());
123 #ifdef OSMIUM_WANT_NODE_LOCATION_MAPS 127 #endif // OSMIUM_INDEX_MAP_SPARSE_MEM_MAP_HPP Definition: sparse_mem_map.hpp:59
TValue get(const TId id) const final
Definition: sparse_mem_map.hpp:79
#define REGISTER_MAP(id, value, klass, name)
Definition: map.hpp:285
uint64_t unsigned_object_id_type
Type for OSM object (node, way, or relation) IDs where we only allow positive IDs.
Definition: types.hpp:46
size_t size() const noexcept final
Definition: sparse_mem_map.hpp:95
void set(const TId id, const TValue value) final
Set the field with id to value.
Definition: sparse_mem_map.hpp:75
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: sparse_mem_map.hpp:66
TValue get_noexcept(const TId id) const noexcept final
Definition: sparse_mem_map.hpp:87
Definition: location.hpp:271
void clear() final
Definition: sparse_mem_map.hpp:103
size_t used_memory() const noexcept final
Definition: sparse_mem_map.hpp:99
void dump_as_list(const int fd) final
Definition: sparse_mem_map.hpp:107
std::map< TId, TValue > m_elements
Definition: sparse_mem_map.hpp:69