osrm-backend/include/engine/osrm_impl.hpp

66 lines
1.3 KiB
C++
Raw Normal View History

2015-01-27 10:35:19 -05:00
#ifndef OSRM_IMPL_HPP
#define OSRM_IMPL_HPP
2013-12-13 12:32:24 -05:00
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"
#include <memory>
2014-05-09 12:40:07 -04:00
#include <unordered_map>
#include <string>
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace util
{
namespace json
{
struct Object;
}
}
namespace engine
{
struct RouteParameters;
namespace plugins
{
class BasePlugin;
}
namespace datafacade
{
struct SharedBarriers;
template <class EdgeDataT> class BaseDataFacade;
2016-01-05 10:51:13 -05:00
}
2015-12-15 13:25:26 -05:00
class OSRM::OSRM_impl final
{
private:
2016-01-05 10:51:13 -05:00
using PluginMap = std::unordered_map<std::string, std::unique_ptr<plugins::BasePlugin>>;
public:
2015-12-15 13:25:26 -05:00
OSRM_impl(LibOSRMConfig &lib_config);
OSRM_impl(const OSRM_impl &) = delete;
2016-01-05 10:51:13 -05:00
int RunQuery(const RouteParameters &route_parameters, util::json::Object &json_result);
2013-12-13 12:32:24 -05:00
private:
2016-01-05 10:51:13 -05:00
void RegisterPlugin(plugins::BasePlugin *plugin);
2013-12-13 12:32:24 -05:00
PluginMap plugin_map;
// will only be initialized if shared memory is used
2016-01-05 10:51:13 -05:00
std::unique_ptr<datafacade::SharedBarriers> barrier;
// base class pointer to the objects
2016-01-05 10:51:13 -05:00
datafacade::BaseDataFacade<contractor::QueryEdge::EdgeData> *query_data_facade;
// 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
};
2016-01-05 10:51:13 -05:00
}
}
2013-12-13 12:32:24 -05:00
2015-01-27 10:35:19 -05:00
#endif // OSRM_IMPL_HPP