2016-01-28 10:28:44 -05:00
|
|
|
#ifndef SERVER_SERVICE_BASE_SERVICE_HPP
|
|
|
|
#define SERVER_SERVICE_BASE_SERVICE_HPP
|
|
|
|
|
|
|
|
#include "engine/status.hpp"
|
|
|
|
#include "osrm/osrm.hpp"
|
2016-05-27 15:05:04 -04:00
|
|
|
#include "util/coordinate.hpp"
|
2016-01-28 10:28:44 -05:00
|
|
|
|
2016-12-01 19:59:29 -05:00
|
|
|
#include <mapbox/variant.hpp>
|
2016-03-02 19:48:30 -05:00
|
|
|
|
2016-01-28 10:28:44 -05:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace server
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
|
|
|
|
|
|
|
class BaseService
|
|
|
|
{
|
|
|
|
public:
|
2016-03-02 19:48:30 -05:00
|
|
|
using ResultT = mapbox::util::variant<util::json::Object, std::string>;
|
|
|
|
|
2016-01-28 10:28:44 -05:00
|
|
|
BaseService(OSRM &routing_machine) : routing_machine(routing_machine) {}
|
|
|
|
virtual ~BaseService() = default;
|
|
|
|
|
2016-05-27 15:05:04 -04:00
|
|
|
virtual engine::Status
|
|
|
|
RunQuery(std::size_t prefix_length, std::string &query, ResultT &result) = 0;
|
2016-02-17 18:49:10 -05:00
|
|
|
|
2016-01-28 10:28:44 -05:00
|
|
|
virtual unsigned GetVersion() = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
OSRM &routing_machine;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|