Libosmium
2.15.6
Fast and flexible C++ library for working with OpenStreetMap data
|
Go to the documentation of this file. 1 #ifndef OSMIUM_MEMORY_ITEM_HPP
2 #define OSMIUM_MEMORY_ITEM_HPP
64 inline constexpr std::size_t
padded_length(std::size_t length) noexcept {
81 ItemHelper() noexcept = default;
83 ItemHelper(const ItemHelper&) noexcept = default;
84 ItemHelper(ItemHelper&&) noexcept = default;
86 ItemHelper& operator=(const ItemHelper&) noexcept = default;
87 ItemHelper& operator=(ItemHelper&&) noexcept = default;
89 ~ItemHelper() noexcept = default;
93 unsigned char* data() noexcept {
94 return reinterpret_cast<unsigned char*
>(
this);
97 const unsigned char* data() const noexcept {
98 return reinterpret_cast<const unsigned char*
>(
this);
105 class Item :
public osmium::memory::detail::ItemHelper {
113 template <
typename TMember>
116 template <
typename TMember>
149 ~Item() noexcept = default;
155 unsigned char*
next() noexcept {
159 const unsigned char*
next() const noexcept {
188 static constexpr
const char* diff_chars =
"*-+ ";
189 return diff_chars[
m_diff];
203 #endif // OSMIUM_MEMORY_ITEM_HPP
Item & set_type(const item_type item_type) noexcept
Definition: item.hpp:136
diff_indicator_type
Definition: item.hpp:48
unsigned char * next() noexcept
Definition: item.hpp:155
uint16_t m_removed
Definition: item.hpp:109
constexpr static bool is_compatible_to(osmium::item_type) noexcept
Definition: item.hpp:151
uint16_t m_diff
Definition: item.hpp:110
const unsigned char * next() const noexcept
Definition: item.hpp:159
Item(item_size_type size=0, item_type type=item_type{}) noexcept
Definition: item.hpp:128
Definition: collection.hpp:47
Item & operator=(const Item &)=delete
void set_removed(const bool removed) noexcept
Definition: item.hpp:179
uint16_t m_padding
Definition: item.hpp:111
item_size_type m_size
Definition: item.hpp:107
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
bool removed() const noexcept
Definition: item.hpp:175
char diff_as_char() const noexcept
Definition: item.hpp:187
uint32_t size() const noexcept
Definition: builder.hpp:133
Definition: item_iterator.hpp:59
item_size_type byte_size() const noexcept
Definition: item.hpp:163
uint32_t item_size_type
Definition: item.hpp:57
item_type m_type
Definition: item.hpp:108
item_type type() const noexcept
Definition: item.hpp:171
diff_indicator_type diff() const noexcept
Definition: item.hpp:183
Definition: builder.hpp:57
constexpr std::size_t padded_length(std::size_t length) noexcept
Definition: item.hpp:64
Item & add_size(const item_size_type size) noexcept
Definition: item.hpp:121
item_size_type padded_size() const
Definition: item.hpp:167
@ align_bytes
Definition: item.hpp:61
item_type
Definition: item_type.hpp:43
void set_diff(const diff_indicator_type diff) noexcept
Definition: item.hpp:192