Add viaroute suport for new API
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#ifndef SERVER_SERVICE_BASE_SERVICE_HPP
|
||||
#define SERVER_SERVICE_BASE_SERVICE_HPP
|
||||
|
||||
#include "engine/status.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "osrm/osrm.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace server
|
||||
{
|
||||
namespace service
|
||||
{
|
||||
|
||||
class BaseService
|
||||
{
|
||||
public:
|
||||
BaseService(OSRM &routing_machine) : routing_machine(routing_machine) {}
|
||||
virtual ~BaseService() = default;
|
||||
|
||||
virtual engine::Status RunQuery(std::vector<util::FixedPointCoordinate> coordinates,
|
||||
std::string &options,
|
||||
util::json::Object &json_result) = 0;
|
||||
virtual unsigned GetVersion() = 0;
|
||||
|
||||
protected:
|
||||
OSRM &routing_machine;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef SERVER_SERVICE_ROUTE_SERVICE_HPP
|
||||
#define SERVER_SERVICE_ROUTE_SERVICE_HPP
|
||||
|
||||
#include "server/service/base_service.hpp"
|
||||
|
||||
#include "engine/status.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "osrm/osrm.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace server
|
||||
{
|
||||
namespace service
|
||||
{
|
||||
|
||||
class RouteService final : public BaseService
|
||||
{
|
||||
public:
|
||||
RouteService(OSRM& routing_machine) : BaseService(routing_machine) {}
|
||||
|
||||
virtual engine::Status RunQuery(std::vector<util::FixedPointCoordinate> coordinates,
|
||||
std::string &options,
|
||||
util::json::Object &json_result) final override;
|
||||
virtual unsigned GetVersion() final override { return 1; }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user