55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef _WRITEINDB_HH_
|
|
#define _WRITEINDB_HH_
|
|
|
|
#include <cstdio>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <cstring>
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
#include "../owlps-positioning/referencepoint.hh"
|
|
#include "../owlps-positioning/point.hh"
|
|
#include "../owlps-positioning/accesspoint.hh"
|
|
#include "../owlps-positioning/area.hh"
|
|
#include "../owlps-positioning/measurement.hh"
|
|
|
|
#include <postgresql/libpq-fe.h>
|
|
#include <boost/program_options.hpp>
|
|
|
|
using namespace std;
|
|
namespace po = boost::program_options;
|
|
|
|
class WriteInDb
|
|
{
|
|
|
|
private:
|
|
vector<ReferencePoint> reference_point_list;
|
|
vector<AccessPoint> access_point_list;
|
|
vector<Point> waypoint_list;
|
|
map<string, Area> area_list;
|
|
|
|
public:
|
|
WriteInDb() {};
|
|
~WriteInDb() {};
|
|
|
|
void makeReferencePointListFromFile(const string &filename, const bool);
|
|
void makeApListFromFile(const string &filename);
|
|
void makeTopologyFromFile(const string &filename);
|
|
void makeWaypointListFromFile(const string &filename);
|
|
|
|
void writeAccessPointToDb(PGconn*);
|
|
void writeWaypointToDb(PGconn*);
|
|
int writePointToDb(PGconn *conn, Point p);
|
|
void writeReferencePointToDb(PGconn*);
|
|
void writeTopologyToDb(PGconn*);
|
|
|
|
bool pointExists(const vector<ReferencePoint> &point_list, const Point &p) const ;
|
|
int pointIndex(const vector<ReferencePoint> &point_list, const Point &p) const ;
|
|
};
|
|
|
|
#endif
|