From d572d77b4882e8a04b5a2f69d7722cd53f641b9e Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Wed, 17 Feb 2016 13:03:16 -0800 Subject: [PATCH] Fix deleting incomplete type and make Engine moveable only --- include/engine/engine.hpp | 4 ++-- src/engine/engine.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/engine/engine.hpp b/include/engine/engine.hpp index 24e9788d0..13032006f 100644 --- a/include/engine/engine.hpp +++ b/include/engine/engine.hpp @@ -55,8 +55,8 @@ class Engine final explicit Engine(EngineConfig &config); - Engine(const Engine &) = delete; - Engine &operator=(const Engine &) = delete; + Engine(Engine &&) noexcept; + Engine &operator=(Engine &&) noexcept; // Impl. in cpp since for unique_ptr of incomplete types ~Engine(); diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 87903f916..f1d4b3f16 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -5,7 +5,7 @@ #include "engine/plugins/table.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/trip.hpp" #include "engine/plugins/viaroute.hpp" @@ -136,13 +136,13 @@ Engine::Engine(EngineConfig &config) route_plugin = util::make_unique(*query_data_facade, config.max_locations_viaroute); table_plugin = util::make_unique(*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 -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) {