osrm-backend/include/engine/plugins/trip.hpp

57 lines
1.5 KiB
C++
Raw Normal View History

#ifndef TRIP_HPP
#define TRIP_HPP
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
#include <boost/assert.hpp>
#include <algorithm>
2016-05-27 15:05:04 -04:00
#include <cstdlib>
#include <iterator>
#include <memory>
#include <string>
#include <utility>
#include <vector>
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
{
private:
mutable SearchEngineData heaps;
mutable routing_algorithms::ShortestPathRouting shortest_path;
mutable routing_algorithms::ManyToManyRouting duration_table;
const int max_locations_trip;
InternalRouteResult ComputeRoute(const std::shared_ptr<const datafacade::BaseDataFacade> facade,
const std::vector<PhantomNode> &phantom_node_list,
const std::vector<NodeID> &trip,
const bool roundtrip) const;
2015-08-20 09:32:28 -04:00
2016-02-22 15:15:02 -05:00
public:
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
{
}
2016-02-22 15:15:02 -05:00
Status HandleRequest(const std::shared_ptr<const datafacade::BaseDataFacade> facade,
const api::TripParameters &parameters,
util::json::Object &json_result) const;
};
2016-01-05 10:51:13 -05:00
}
}
}
#endif // TRIP_HPP