forked from osm2pgsql-dev/osm2pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.hpp
77 lines (53 loc) · 2.12 KB
/
output.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* Common output layer interface */
/* Each output layer must provide methods for
* storing:
* - Nodes (Points of interest etc)
* - Way geometries
* Associated tags: name, type etc.
*/
#ifndef OUTPUT_H
#define OUTPUT_H
#include <stack>
#include <boost/noncopyable.hpp>
#include "options.hpp"
struct expire_tiles;
struct id_tracker;
struct middle_query_t;
struct pending_job_t {
osmid_t osm_id;
size_t output_id;
pending_job_t() : osm_id(0), output_id(0) {}
pending_job_t(osmid_t id, size_t oid) : osm_id(id), output_id(oid) {}
};
typedef std::stack<pending_job_t> pending_queue_t;
class output_t : public boost::noncopyable {
public:
static std::vector<std::shared_ptr<output_t> > create_outputs(const middle_query_t *mid, const options_t &options);
output_t(const middle_query_t *mid, const options_t &options_);
virtual ~output_t();
virtual std::shared_ptr<output_t> clone(const middle_query_t* cloned_middle) const = 0;
virtual int start() = 0;
virtual void stop() = 0;
virtual void commit() = 0;
virtual void enqueue_ways(pending_queue_t &job_queue, osmid_t id, size_t output_id, size_t& added) = 0;
virtual int pending_way(osmid_t id, int exists) = 0;
virtual void enqueue_relations(pending_queue_t &job_queue, osmid_t id, size_t output_id, size_t& added) = 0;
virtual int pending_relation(osmid_t id, int exists) = 0;
virtual int node_add(osmium::Node const &node) = 0;
virtual int way_add(osmium::Way *way) = 0;
virtual int relation_add(osmium::Relation const &rel) = 0;
virtual int node_modify(osmium::Node const &node) = 0;
virtual int way_modify(osmium::Way *way) = 0;
virtual int relation_modify(osmium::Relation const &rel) = 0;
virtual int node_delete(osmid_t id) = 0;
virtual int way_delete(osmid_t id) = 0;
virtual int relation_delete(osmid_t id) = 0;
virtual size_t pending_count() const;
const options_t *get_options() const;
virtual void merge_pending_relations(output_t *other);
virtual void merge_expire_trees(output_t *other);
protected:
const middle_query_t* m_mid;
const options_t m_options;
};
#endif