1#ifndef OSMIUM_UTIL_DELTA_HPP
2#define OSMIUM_UTIL_DELTA_HPP
43 inline namespace util {
48 template <
typename TValue,
typename TDelta =
int64_t>
51 "DeltaEncode value type must be some integer");
53 "DeltaEncode delta type must be some signed integer");
57 "Delta type size should be larger or equal to value type size");
78 TDelta
update(TValue new_value)
noexcept {
84 return static_cast<TDelta
>(
m_value) -
85 static_cast<TDelta
>(new_value);
93 template <
typename TValue,
typename TDelta =
int64_t>
96 "DeltaDecode value type must be some integer");
98 "DeltaDecode delta type must be some signed integer");
121 static_cast<TDelta
>(
m_value) + delta);
TValue m_value
Definition: delta.hpp:100
DeltaDecode()
Definition: delta.hpp:107
void clear() noexcept
Definition: delta.hpp:111
TValue update(TDelta delta) noexcept
Definition: delta.hpp:115
TDelta delta_type
Definition: delta.hpp:105
TValue value() const noexcept
Definition: delta.hpp:125
TValue value_type
Definition: delta.hpp:104
TValue m_value
Definition: delta.hpp:59
TValue value_type
Definition: delta.hpp:63
TDelta delta_type
Definition: delta.hpp:64
DeltaEncode(TValue value=0)
Definition: delta.hpp:66
TDelta update(TValue new_value) noexcept
Definition: delta.hpp:78
TValue value() const noexcept
Definition: delta.hpp:74
void clear() noexcept
Definition: delta.hpp:70
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53