#ifndef ENGINE_HPP #define ENGINE_HPP #include "engine/status.hpp" #include "util/json_container.hpp" #include #include #include #include namespace osrm { namespace util { namespace json { struct Object; } } namespace storage { struct SharedBarriers; } // Fwd decls namespace engine { struct EngineConfig; namespace api { struct RouteParameters; struct TableParameters; struct NearestParameters; struct TripParameters; struct MatchParameters; struct TileParameters; } namespace plugins { class ViaRoutePlugin; class TablePlugin; class NearestPlugin; class TripPlugin; class MatchPlugin; class TilePlugin; } // End fwd decls namespace datafacade { class BaseDataFacade; } class DataWatchdog; class Engine final { public: explicit Engine(const EngineConfig &config); Engine(Engine &&) noexcept; Engine &operator=(Engine &&) noexcept; // Impl. in cpp since for unique_ptr of incomplete types ~Engine(); Status Route(const api::RouteParameters ¶meters, util::json::Object &result) const; Status Table(const api::TableParameters ¶meters, util::json::Object &result) const; Status Nearest(const api::NearestParameters ¶meters, util::json::Object &result) const; Status Trip(const api::TripParameters ¶meters, util::json::Object &result) const; Status Match(const api::MatchParameters ¶meters, util::json::Object &result) const; Status Tile(const api::TileParameters ¶meters, std::string &result) const; private: std::unique_ptr lock; std::unique_ptr watchdog; std::unique_ptr route_plugin; std::unique_ptr table_plugin; std::unique_ptr nearest_plugin; std::unique_ptr trip_plugin; std::unique_ptr match_plugin; std::unique_ptr tile_plugin; // note in case of shared memory this will be empty, since the watchdog // will provide us with the up-to-date facade std::shared_ptr immutable_data_facade; }; } } #endif // OSRM_IMPL_HPP