File: osmdata.hpp

package info (click to toggle)
osm2pgsql 0.96.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,304 kB
  • sloc: cpp: 11,462; python: 543; sh: 98; makefile: 17
file content (48 lines) | stat: -rw-r--r-- 1,228 bytes parent folder | download
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
#ifndef OSMDATA_H
#define OSMDATA_H

// when __cplusplus is defined, we need to define this macro as well
// to get the print format specifiers in the inttypes.h header.
#include "config.h"

#include <vector>
#include <memory>

#include "osmtypes.hpp"

class output_t;
struct middle_t;
class reprojection;

class osmdata_t {
public:
    osmdata_t(std::shared_ptr<middle_t> mid_,
              std::shared_ptr<output_t> const &out_,
              std::shared_ptr<reprojection> proj);
    osmdata_t(std::shared_ptr<middle_t> mid_,
              std::vector<std::shared_ptr<output_t> > const &outs_,
              std::shared_ptr<reprojection> proj);
    ~osmdata_t();

    void start();
    void stop();

    int node_add(osmium::Node const &node);
    int way_add(osmium::Way *way);
    int relation_add(osmium::Relation const &rel);

    int node_modify(osmium::Node const &node);
    int way_modify(osmium::Way *way);
    int relation_modify(osmium::Relation const &rel);

    int node_delete(osmid_t id);
    int way_delete(osmid_t id);
    int relation_delete(osmid_t id);

private:
    std::shared_ptr<middle_t> mid;
    std::vector<std::shared_ptr<output_t> > outs;
    std::shared_ptr<reprojection> projection;
};

#endif