本文整理汇总了C++中osmium::memory::Buffer::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Buffer::end方法的具体用法?C++ Buffer::end怎么用?C++ Buffer::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osmium::memory::Buffer
的用法示例。
在下文中一共展示了Buffer::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
osmium::item_type operator()(osmium::memory::Buffer& buffer) {
return operator()(buffer.begin(), buffer.end());
}
示例2: apply_diff
inline void apply_diff(osmium::memory::Buffer& buffer, THandlers&... handlers) {
apply_diff(buffer.begin(), buffer.end(), handlers...);
}
示例3: box
#include <osmium/io/xml_input.hpp>
TEST_CASE("Single relation") {
SECTION("Should extract the relation because it uses a node in the bounding box") {
using id_set = std_id_set;
osmium::io::File file(test_data_file("test_single_relation.osm"));
osmium::Box box(osmium::Location(double(-1), double(-1)),
osmium::Location(double( 1), double( 1)));
hsplitter::HistoryExtractReader<id_set> reader =
hsplitter::read_extract<id_set>(file, box);
REQUIRE(!reader.eof());
osmium::memory::Buffer buffer = reader.read();
REQUIRE(std::distance(buffer.begin(), buffer.end()) == 2);
osmium::memory::Buffer::iterator itr = buffer.begin();
{
REQUIRE(itr->type() == osmium::item_type::node);
auto &node = static_cast<const osmium::Node &>(*itr++);
REQUIRE(node.id() == 1);
}
{
REQUIRE(itr->type() == osmium::item_type::relation);
auto &rel = static_cast<const osmium::Relation &>(*itr++);
REQUIRE(rel.id() == 1);
}
}
SECTION("Should extract the relation because it uses a way which uses a node in the bbox") {
using id_set = std_id_set;
示例4: operator
// XXX
void operator()(const osmium::memory::Buffer& buffer) {
osmium::io::detail::reliable_write(m_data_fd, buffer.data(), buffer.committed());
osmium::apply(buffer.begin(), buffer.end(), *this);
}
示例5: get_next_iter
buffer_iterator_pair get_next_iter() {
m_buffer = read();
return std::make_pair(m_buffer.begin(), m_buffer.end());
}
示例6: rels
constexpr size_t buffer_size = 10000;
unsigned char data[buffer_size];
map_t node_tiles, way_tiles, extra_node_tiles;
node_tiles.m_map[1] = std::set<hsplitter::tile_t>({1});
node_tiles.m_map[2] = std::set<hsplitter::tile_t>({1});
node_tiles.m_map[3] = std::set<hsplitter::tile_t>({1});
node_tiles.freeze();
way_tiles.freeze();
extra_node_tiles.freeze();
osmium::memory::Buffer rels(data, buffer_size, 0);
push_back_rel(rels, 1, 1, true, 1, 1, {1, 2, 3}, {}, {});
REQUIRE(std::distance(rels.begin(), rels.end()) == 1);
auto it = rels.begin();
auto pair = hsplitter::tiles_for_relations<map_t>(it, rels.end(), node_tiles, way_tiles, extra_node_tiles);
map_t rel_tiles = std::move(pair.first);
map_t extra_rel_tiles = std::move(pair.second);
REQUIRE(rel_tiles.m_map.size() == 1);
REQUIRE(rel_tiles.m_map.count(1) == 1);
REQUIRE(rel_tiles.m_map[1].size() == 1);
REQUIRE(rel_tiles.m_map[1].count(1) == 1);
REQUIRE(extra_rel_tiles.m_map.empty());
}
SECTION("should account for ways.") {
using map_t = tileset;