KItinerary
28 inline constexpr Coordinate()
34 inline explicit constexpr Coordinate(
float lng,
float lat)
40 inline bool isValid()
const
42 return !std::isnan(latitude) && !std::isnan(longitude);
45 inline constexpr bool operator==(Coordinate other)
const
47 return latitude == other.latitude && longitude == other.longitude;
59template <
int N>
class UnalignedNumber :
private UnalignedNumber<N-1> {
61 inline constexpr UnalignedNumber() =
default;
62 inline explicit constexpr UnalignedNumber(uint32_t num)
63 : UnalignedNumber<N-1>(num)
64 , m_value((num & (0xFF << (N-1)*8)) >> (N-1)*8)
67 inline constexpr bool operator==(UnalignedNumber<N> other)
const
69 if (m_value == other.m_value) {
70 return UnalignedNumber<N-1>::operator==(other);
74 inline constexpr bool operator!=(UnalignedNumber<N> other)
const
76 if (m_value == other.m_value) {
77 return UnalignedNumber<N-1>::operator!=(other);
81 inline constexpr bool operator<(UnalignedNumber<N> other)
const
83 if (m_value == other.m_value) {
84 return UnalignedNumber<N-1>::operator<(other);
86 return m_value < other.m_value;
89 inline constexpr UnalignedNumber<N>& operator=(uint32_t num)
94 inline constexpr UnalignedNumber<N>& operator|=(uint32_t num)
96 setValue(value() | num);
100 inline constexpr operator uint32_t()
const
105 inline constexpr uint32_t value()
const
107 return UnalignedNumber<N-1>::value() | (m_value << (N-1)*8);
111 inline constexpr void setValue(uint32_t num)
113 m_value = (num & (0xFF << (N-1)*8)) >> (N-1)*8;
114 UnalignedNumber<N-1>::setValue(num);
125 : m_value(num & 0xFF)
128 inline constexpr bool operator==(UnalignedNumber<1> other)
const
130 return m_value == other.m_value;
132 inline constexpr bool operator!=(UnalignedNumber<1> other)
const
134 return m_value != other.m_value;
136 inline constexpr bool operator<(UnalignedNumber<1> other)
const
138 return m_value < other.m_value;
141 inline constexpr uint32_t value()
const
147 inline constexpr void setValue(uint32_t num)
149 m_value = num & 0xFF;
Unalinged storage of a numerical value.
Lookup functions, utilities and data types for the static knowledge database.
Classes for reservation/travel data models, data extraction and data augmentation.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:56:45 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.