osrm-backend/include/engine/engine.hpp

69 lines
1.3 KiB
C++
Raw Normal View History

#ifndef ENGINE_HPP
#define ENGINE_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/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 storage
{
struct SharedBarriers;
}
2016-01-05 10:51:13 -05:00
namespace util
{
namespace json
{
struct Object;
}
}
namespace engine
{
struct EngineConfig;
2016-01-05 10:51:13 -05:00
struct RouteParameters;
namespace plugins
{
class BasePlugin;
}
namespace datafacade
{
template <class EdgeDataT> class BaseDataFacade;
2016-01-05 10:51:13 -05:00
}
class Engine final
{
private:
2016-01-05 10:51:13 -05:00
using PluginMap = std::unordered_map<std::string, std::unique_ptr<plugins::BasePlugin>>;
public:
Engine(EngineConfig &config_);
Engine(const Engine &) = 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
std::unique_ptr<storage::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