2015-08-20 10:07:56 -04:00
|
|
|
#ifndef TRIP_HPP
|
|
|
|
#define TRIP_HPP
|
2015-04-22 11:19:54 -04:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "engine/plugins/plugin_base.hpp"
|
|
|
|
|
2016-02-22 15:15:02 -05:00
|
|
|
#include "engine/api/trip_parameters.hpp"
|
|
|
|
#include "engine/routing_algorithms/many_to_many.hpp"
|
2016-05-27 15:05:04 -04:00
|
|
|
#include "engine/routing_algorithms/shortest_path.hpp"
|
2016-02-22 15:15:02 -05:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "osrm/json_container.hpp"
|
2016-01-04 04:19:25 -05:00
|
|
|
|
2015-08-18 07:48:12 -04:00
|
|
|
#include <boost/assert.hpp>
|
2015-04-22 11:19:54 -04:00
|
|
|
|
|
|
|
#include <algorithm>
|
2016-05-27 15:05:04 -04:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <iterator>
|
2015-04-22 11:19:54 -04:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2015-08-19 08:04:59 -04:00
|
|
|
#include <utility>
|
2015-04-22 11:19:54 -04:00
|
|
|
#include <vector>
|
2015-08-18 07:48:12 -04:00
|
|
|
|
2016-01-05 10:51:13 -05:00
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace engine
|
|
|
|
{
|
|
|
|
namespace plugins
|
|
|
|
{
|
|
|
|
|
2016-02-22 15:15:02 -05:00
|
|
|
class TripPlugin final : public BasePlugin
|
2015-04-22 11:19:54 -04:00
|
|
|
{
|
|
|
|
private:
|
2016-02-22 15:15:02 -05:00
|
|
|
SearchEngineData heaps;
|
|
|
|
routing_algorithms::ShortestPathRouting<datafacade::BaseDataFacade> shortest_path;
|
|
|
|
routing_algorithms::ManyToManyRouting<datafacade::BaseDataFacade> duration_table;
|
2015-12-16 22:14:06 -05:00
|
|
|
int max_locations_trip;
|
2015-04-22 11:19:54 -04:00
|
|
|
|
2016-10-05 19:05:03 -04:00
|
|
|
InternalRouteResult ComputeRoute(const datafacade::BaseDataFacade &facade,
|
|
|
|
const std::vector<PhantomNode> &phantom_node_list,
|
2016-02-22 15:15:02 -05:00
|
|
|
const std::vector<NodeID> &trip);
|
2015-08-20 09:32:28 -04:00
|
|
|
|
2016-02-22 15:15:02 -05:00
|
|
|
public:
|
2016-10-05 19:05:03 -04:00
|
|
|
explicit TripPlugin(const int max_locations_trip_)
|
2016-10-05 06:33:58 -04:00
|
|
|
: shortest_path(heaps), duration_table(heaps), max_locations_trip(max_locations_trip_)
|
2015-07-01 08:07:25 -04:00
|
|
|
{
|
2015-04-22 11:19:54 -04:00
|
|
|
}
|
2016-02-22 15:15:02 -05:00
|
|
|
|
2016-10-05 19:05:03 -04:00
|
|
|
Status HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade,
|
|
|
|
const api::TripParameters ¶meters,
|
|
|
|
util::json::Object &json_result);
|
2015-04-22 11:19:54 -04:00
|
|
|
};
|
2016-01-05 10:51:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-20 10:07:56 -04:00
|
|
|
#endif // TRIP_HPP
|