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_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;
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>
111 inline std::basic_ostream<TChar, TTraits>&
operator<<(std::basic_ostream<TChar, TTraits>& out,
const CollectionIterator<TMember>& iter) {
116 template <
typename TMember, osmium::item_type TCollectionItemType>
135 Item(sizeof(
Collection<TMember, TCollectionItemType>), TCollectionItemType) {
186 #endif // OSMIUM_MEMORY_COLLECTION_HPP
size_type size() const noexcept
Definition: collection.hpp:152
const_iterator end() const noexcept
Definition: collection.hpp:176
TMember value_type
Definition: collection.hpp:59
const_iterator begin() const noexcept
Definition: collection.hpp:172
bool operator==(const CollectionIterator< TMember > &rhs) const noexcept
Definition: collection.hpp:83
CollectionIterator< TMember > operator++(int)
Definition: collection.hpp:77
TMember & operator*() const noexcept
Definition: collection.hpp:95
typename std::conditional< std::is_const< TMember >::value, const unsigned char *, unsigned char * >::type data_type
Definition: collection.hpp:52
std::ptrdiff_t difference_type
Definition: collection.hpp:60
static constexpr osmium::item_type itemtype
Definition: collection.hpp:128
Collection() noexcept
Definition: collection.hpp:134
bool operator!=(const CollectionIterator< TMember > &rhs) const noexcept
Definition: collection.hpp:87
std::basic_ostream< TChar, TTraits > & operator<<(std::basic_ostream< TChar, TTraits > &out, const CollectionIterator< TMember > &iter)
Definition: collection.hpp:111
Definition: collection.hpp:47
CollectionIterator(data_type data) noexcept
Definition: collection.hpp:68
const_iterator cbegin() const noexcept
Definition: collection.hpp:164
bool empty() const noexcept
Definition: collection.hpp:143
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
data_type m_data
Definition: collection.hpp:54
const_iterator cend() const noexcept
Definition: collection.hpp:168
item_size_type byte_size() const noexcept
Definition: item.hpp:163
iterator end() noexcept
Definition: collection.hpp:160
std::forward_iterator_tag iterator_category
Definition: collection.hpp:58
constexpr static bool is_compatible_to(const osmium::item_type t) noexcept
Definition: collection.hpp:130
Definition: relation.hpp:57
iterator begin() noexcept
Definition: collection.hpp:156
double distance(const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2) noexcept
Definition: haversine.hpp:66
CollectionIterator< TMember > & operator++()
Definition: collection.hpp:72
value_type * pointer
Definition: collection.hpp:61
TMember * operator->() const noexcept
Definition: collection.hpp:99
void print(std::basic_ostream< TChar, TTraits > &out) const
Definition: collection.hpp:104
std::size_t size_type
Definition: collection.hpp:126
CollectionIterator() noexcept
Definition: collection.hpp:64
Definition: collection.hpp:117
unsigned char * data() const noexcept
Definition: collection.hpp:91
type
Definition: entity_bits.hpp:63
value_type & reference
Definition: collection.hpp:62
item_type
Definition: item_type.hpp:43