Loading...
Searching...
No Matches
dummy.hpp
Go to the documentation of this file.
#ifndef OSMIUM_INDEX_MAP_DUMMY_HPP
#define OSMIUM_INDEX_MAP_DUMMY_HPP
/*
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <osmium/index/index.hpp>
#include <osmium/index/map.hpp>
#include <cstddef>
namespace osmium {
namespace index {
namespace map {
template <typename TId, typename TValue>
class Dummy : public osmium::index::map::Map<TId, TValue> {
public:
Dummy() = default;
Dummy(const Dummy&) = default;
Dummy& operator=(const Dummy&) = default;
Dummy(Dummy&&) noexcept = default;
Dummy& operator=(Dummy&&) noexcept = default;
~Dummy() noexcept override = default;
void set(const TId /*id*/, const TValue /*value*/) final {
// intentionally left blank
}
TValue get(const TId id) const final {
throw osmium::not_found{id};
}
TValue get_noexcept(const TId /*id*/) const noexcept final {
return osmium::index::empty_value<TValue>();
}
size_t size() const final {
return 0;
}
size_t used_memory() const final {
return 0;
}
void clear() final {
}
}; // class Dummy
} // namespace map
} // namespace index
} // namespace osmium
#endif // OSMIUM_INDEX_MAP_DUMMY_HPP
osmium::index::map::Dummy
Definition dummy.hpp:53
osmium::index::map::Dummy::set
void set(const TId, const TValue) final
Set the field with id to value.
Definition dummy.hpp:67
osmium::index::map::Dummy::get
TValue get(const TId id) const final
Definition dummy.hpp:71
osmium::index::map::Dummy::get_noexcept
TValue get_noexcept(const TId) const noexcept final
Definition dummy.hpp:75
osmium::index::map::Dummy::Dummy
Dummy(Dummy &&) noexcept=default
osmium::index::map::Dummy::size
size_t size() const final
Definition dummy.hpp:79
osmium::index::map::Dummy::operator=
Dummy & operator=(const Dummy &)=default
osmium::index::map::Dummy::used_memory
size_t used_memory() const final
Definition dummy.hpp:83
osmium::index::map::Dummy::Dummy
Dummy(const Dummy &)=default
osmium::index::map::Dummy::clear
void clear() final
Definition dummy.hpp:87
osmium::index::map::Dummy::Dummy
Dummy()=default
osmium::index::map::Map
Definition map.hpp:97
index.hpp
map.hpp
osmium::index::empty_value
constexpr T empty_value()
Definition index.hpp:79
osmium
Namespace for everything in the Osmium library.
Definition assembler.hpp:53
osmium::not_found
Definition index.hpp:50