1 #ifndef OSMIUM_MEMORY_COLLECTION_HPP 2 #define OSMIUM_MEMORY_COLLECTION_HPP 40 #include <type_traits> 46 template <
typename TMember>
52 using data_type =
typename std::conditional<std::is_const<TMember>::value,
const unsigned char*,
unsigned char*>
::type;
73 m_data =
reinterpret_cast<TMember*
>(
m_data)->next();
84 return m_data == rhs.m_data;
88 return !(*
this == rhs);
91 unsigned char*
data() const noexcept {
96 return *
reinterpret_cast<TMember*
>(
m_data);
100 return reinterpret_cast<TMember*
>(
m_data);
103 template <
typename TChar,
typename TTraits>
104 void print(std::basic_ostream<TChar, TTraits>& out)
const {
105 out << static_cast<const void*>(
m_data);
110 template <
typename TChar,
typename TTraits,
typename TMember>
116 template <
typename TMember, osmium::item_type TCollectionItemType>
131 return t == itemtype;
135 Item(sizeof(
Collection<TMember, TCollectionItemType>), TCollectionItemType) {
186 #endif // OSMIUM_MEMORY_COLLECTION_HPP Collection() noexcept
Definition: collection.hpp:134
std::size_t size_type
Definition: collection.hpp:126
const_iterator begin() const noexcept
Definition: collection.hpp:172
TMember * operator->() const noexcept
Definition: collection.hpp:99
Definition: collection.hpp:47
CollectionIterator< TMember > & operator++()
Definition: collection.hpp:72
type
Definition: entity_bits.hpp:63
value_type & reference
Definition: collection.hpp:62
const_iterator end() const noexcept
Definition: collection.hpp:176
std::ptrdiff_t difference_type
Definition: collection.hpp:60
TMember & operator*() const noexcept
Definition: collection.hpp:95
double distance(const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2) noexcept
Definition: haversine.hpp:66
item_type
Definition: item_type.hpp:43
InputIterator< Reader > end(Reader &)
Definition: reader_iterator.hpp:47
CollectionIterator< TMember > operator++(int)
Definition: collection.hpp:77
std::forward_iterator_tag iterator_category
Definition: collection.hpp:58
const_iterator cbegin() const noexcept
Definition: collection.hpp:164
void print(std::basic_ostream< TChar, TTraits > &out) const
Definition: collection.hpp:104
size_type size() const noexcept
Definition: collection.hpp:152
CollectionIterator() noexcept
Definition: collection.hpp:64
bool operator!=(const CollectionIterator< TMember > &rhs) const noexcept
Definition: collection.hpp:87
InputIterator< Reader > begin(Reader &reader)
Definition: reader_iterator.hpp:43
static constexpr bool is_compatible_to(const osmium::item_type t) noexcept
Definition: collection.hpp:130
Definition: relation.hpp:57
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: collection.hpp:117
const_iterator cend() const noexcept
Definition: collection.hpp:168
bool empty() const noexcept
Definition: collection.hpp:143
typename std::conditional< std::is_const< TMember >::value, const unsigned char *, unsigned char * >::type data_type
Definition: collection.hpp:52
unsigned char * data() const noexcept
Definition: collection.hpp:91
iterator end() noexcept
Definition: collection.hpp:160
TMember value_type
Definition: collection.hpp:59
iterator begin() noexcept
Definition: collection.hpp:156
data_type m_data
Definition: collection.hpp:54
value_type * pointer
Definition: collection.hpp:61
CollectionIterator(data_type data) noexcept
Definition: collection.hpp:68
bool operator==(const CollectionIterator< TMember > &rhs) const noexcept
Definition: collection.hpp:83