Fix deleting incomplete type and make Engine moveable only
This commit is contained in:
parent
a4074332cc
commit
d572d77b48
@ -55,8 +55,8 @@ class Engine final
|
|||||||
|
|
||||||
explicit Engine(EngineConfig &config);
|
explicit Engine(EngineConfig &config);
|
||||||
|
|
||||||
Engine(const Engine &) = delete;
|
Engine(Engine &&) noexcept;
|
||||||
Engine &operator=(const Engine &) = delete;
|
Engine &operator=(Engine &&) noexcept;
|
||||||
|
|
||||||
// Impl. in cpp since for unique_ptr of incomplete types
|
// Impl. in cpp since for unique_ptr of incomplete types
|
||||||
~Engine();
|
~Engine();
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "engine/plugins/table.hpp"
|
#include "engine/plugins/table.hpp"
|
||||||
//#include "engine/plugins/hello_world.hpp"
|
//#include "engine/plugins/hello_world.hpp"
|
||||||
//#include "engine/plugins/nearest.hpp"
|
#include "engine/plugins/nearest.hpp"
|
||||||
//#include "engine/plugins/timestamp.hpp"
|
//#include "engine/plugins/timestamp.hpp"
|
||||||
//#include "engine/plugins/trip.hpp"
|
//#include "engine/plugins/trip.hpp"
|
||||||
#include "engine/plugins/viaroute.hpp"
|
#include "engine/plugins/viaroute.hpp"
|
||||||
@ -136,13 +136,13 @@ Engine::Engine(EngineConfig &config)
|
|||||||
route_plugin = util::make_unique<plugins::ViaRoutePlugin>(*query_data_facade,
|
route_plugin = util::make_unique<plugins::ViaRoutePlugin>(*query_data_facade,
|
||||||
config.max_locations_viaroute);
|
config.max_locations_viaroute);
|
||||||
table_plugin = util::make_unique<plugins::TablePlugin>(*query_data_facade,
|
table_plugin = util::make_unique<plugins::TablePlugin>(*query_data_facade,
|
||||||
config.max_locations_distance_table);
|
config.max_locations_distance_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we deallocate the unique ptr at a position where we know the size of the plugins
|
// make sure we deallocate the unique ptr at a position where we know the size of the plugins
|
||||||
Engine::~Engine()
|
Engine::~Engine() = default;
|
||||||
{
|
Engine::Engine(Engine &&) noexcept = default;
|
||||||
}
|
Engine &Engine::operator=(Engine &&) noexcept = default;
|
||||||
|
|
||||||
Status Engine::Route(const api::RouteParameters &route_parameters, util::json::Object &result)
|
Status Engine::Route(const api::RouteParameters &route_parameters, util::json::Object &result)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user