osrm-backend/include/engine/engine.hpp

85 lines
1.8 KiB
C++
Raw Normal View History

#ifndef ENGINE_HPP
#define ENGINE_HPP
2013-12-13 12:32:24 -05:00
2016-01-28 10:28:44 -05:00
#include "engine/status.hpp"
#include "storage/shared_barriers.hpp"
#include "util/json_container.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;
}
}
2016-02-17 15:56:27 -05:00
// Fwd decls
2016-01-05 10:51:13 -05:00
namespace engine
{
struct EngineConfig;
2016-01-28 10:28:44 -05:00
namespace api
{
2016-01-05 10:51:13 -05:00
struct RouteParameters;
struct TableParameters;
2016-02-17 15:56:27 -05:00
struct NearestParameters;
struct TripParameters;
struct MatchParameters;
2016-01-28 10:28:44 -05:00
}
2016-01-05 10:51:13 -05:00
namespace plugins
{
2016-01-28 10:28:44 -05:00
class ViaRoutePlugin;
2016-02-12 19:48:14 -05:00
class TablePlugin;
2016-02-17 15:56:27 -05:00
class NearestPlugin;
class TripPlugin;
class MatchPlugin;
2016-01-05 10:51:13 -05:00
}
2016-02-17 15:56:27 -05:00
// End fwd decls
2016-01-05 10:51:13 -05:00
namespace datafacade
{
2016-01-28 10:28:44 -05:00
class BaseDataFacade;
2016-01-05 10:51:13 -05:00
}
class Engine final
{
public:
2016-02-12 19:48:14 -05:00
// Needs to be public
struct EngineLock;
explicit Engine(EngineConfig &config);
2016-02-17 15:56:27 -05:00
Engine(Engine &&) noexcept;
Engine &operator=(Engine &&) noexcept;
2016-02-17 15:56:27 -05:00
// Impl. in cpp since for unique_ptr of incomplete types
2016-02-12 19:48:14 -05:00
~Engine();
Status Route(const api::RouteParameters &parameters, util::json::Object &result);
Status Table(const api::TableParameters &parameters, util::json::Object &result);
2016-02-17 15:56:27 -05:00
Status Nearest(const api::NearestParameters &parameters, util::json::Object &result);
Status Trip(const api::TripParameters &parameters, util::json::Object &result);
Status Match(const api::MatchParameters &parameters, util::json::Object &result);
2013-12-13 12:32:24 -05:00
private:
2016-01-28 10:28:44 -05:00
std::unique_ptr<EngineLock> lock;
2016-01-28 10:28:44 -05:00
std::unique_ptr<plugins::ViaRoutePlugin> route_plugin;
2016-02-12 19:48:14 -05:00
std::unique_ptr<plugins::TablePlugin> table_plugin;
2016-02-17 15:56:27 -05:00
std::unique_ptr<plugins::NearestPlugin> nearest_plugin;
// std::unique_ptr<plugins::TripPlugin> trip_plugin;
std::unique_ptr<plugins::MatchPlugin> match_plugin;
2016-01-28 10:28:44 -05:00
std::unique_ptr<datafacade::BaseDataFacade> query_data_facade;
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