2015-01-27 10:35:19 -05:00
|
|
|
#ifndef OSRM_IMPL_HPP
|
|
|
|
#define OSRM_IMPL_HPP
|
2013-12-13 12:32:24 -05:00
|
|
|
|
2014-06-11 06:25:57 -04:00
|
|
|
class BasePlugin;
|
|
|
|
struct RouteParameters;
|
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "contractor/query_edge.hpp"
|
2013-12-13 12:32:24 -05:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "osrm/json_container.hpp"
|
|
|
|
#include "osrm/libosrm_config.hpp"
|
|
|
|
#include "osrm/osrm.hpp"
|
2015-01-08 08:49:10 -05:00
|
|
|
|
2014-10-08 13:30:42 -04:00
|
|
|
#include <memory>
|
2014-05-09 12:40:07 -04:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <string>
|
|
|
|
|
2014-02-11 05:35:29 -05:00
|
|
|
struct SharedBarriers;
|
2014-05-07 10:17:14 -04:00
|
|
|
template <class EdgeDataT> class BaseDataFacade;
|
2014-02-11 05:35:29 -05:00
|
|
|
|
2015-12-15 13:25:26 -05:00
|
|
|
class OSRM::OSRM_impl final
|
2014-05-07 10:17:14 -04:00
|
|
|
{
|
|
|
|
private:
|
2015-12-14 16:00:20 -05:00
|
|
|
using PluginMap = std::unordered_map<std::string, std::unique_ptr<BasePlugin>>;
|
2014-05-07 10:17:14 -04:00
|
|
|
|
|
|
|
public:
|
2015-12-15 13:25:26 -05:00
|
|
|
OSRM_impl(LibOSRMConfig &lib_config);
|
2014-05-07 10:17:14 -04:00
|
|
|
OSRM_impl(const OSRM_impl &) = delete;
|
2015-12-14 16:00:20 -05:00
|
|
|
int RunQuery(const RouteParameters &route_parameters, osrm::json::Object &json_result);
|
2013-12-13 12:32:24 -05:00
|
|
|
|
2014-05-07 10:17:14 -04:00
|
|
|
private:
|
|
|
|
void RegisterPlugin(BasePlugin *plugin);
|
2013-12-13 12:32:24 -05:00
|
|
|
PluginMap plugin_map;
|
2014-10-08 13:30:42 -04:00
|
|
|
// will only be initialized if shared memory is used
|
|
|
|
std::unique_ptr<SharedBarriers> barrier;
|
2014-05-07 10:17:14 -04:00
|
|
|
// base class pointer to the objects
|
|
|
|
BaseDataFacade<QueryEdge::EdgeData> *query_data_facade;
|
2015-01-22 06:35:46 -05:00
|
|
|
|
|
|
|
// decrease number of concurrent queries
|
|
|
|
void decrease_concurrent_query_count();
|
|
|
|
// increase number of concurrent queries
|
|
|
|
void increase_concurrent_query_count();
|
2013-12-13 12:32:24 -05:00
|
|
|
};
|
|
|
|
|
2015-01-27 10:35:19 -05:00
|
|
|
#endif // OSRM_IMPL_HPP
|