From c3b54a63c3d08e034db2913ca537a235f21b75e1 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 8 Oct 2014 17:25:38 +0200 Subject: [PATCH] remove ServerPaths member from OSRM_impl. pass it by value to c'tor --- Library/OSRM.h | 2 +- Library/OSRM_impl.cpp | 5 ++--- Library/OSRM_impl.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Library/OSRM.h b/Library/OSRM.h index 5e3480249..372e82c39 100644 --- a/Library/OSRM.h +++ b/Library/OSRM.h @@ -46,7 +46,7 @@ class OSRM std::unique_ptr OSRM_pimpl_; public: - explicit OSRM(const ServerPaths &paths, const bool use_shared_memory = false); + explicit OSRM(ServerPaths paths, const bool use_shared_memory = false); ~OSRM(); void RunQuery(RouteParameters &route_parameters, http::Reply &reply); }; diff --git a/Library/OSRM_impl.cpp b/Library/OSRM_impl.cpp index 0bbdc7da7..b1c7ef2fb 100644 --- a/Library/OSRM_impl.cpp +++ b/Library/OSRM_impl.cpp @@ -58,8 +58,7 @@ namespace boost { namespace interprocess { class named_mutex; } } #include #include -OSRM_impl::OSRM_impl(const ServerPaths &paths, const bool use_shared_memory) - : server_paths(paths) +OSRM_impl::OSRM_impl(ServerPaths server_paths, const bool use_shared_memory) { if (use_shared_memory) { @@ -158,7 +157,7 @@ void OSRM_impl::RunQuery(RouteParameters &route_parameters, http::Reply &reply) // proxy code for compilation firewall -OSRM::OSRM(const ServerPaths &paths, const bool use_shared_memory) +OSRM::OSRM(ServerPaths paths, const bool use_shared_memory) : OSRM_pimpl_(osrm::make_unique(paths, use_shared_memory)) { } diff --git a/Library/OSRM_impl.h b/Library/OSRM_impl.h index 38b919a8d..803a5b065 100644 --- a/Library/OSRM_impl.h +++ b/Library/OSRM_impl.h @@ -48,7 +48,7 @@ class OSRM_impl using PluginMap = std::unordered_map; public: - OSRM_impl(const ServerPaths &paths, const bool use_shared_memory); + OSRM_impl(ServerPaths paths, const bool use_shared_memory); OSRM_impl(const OSRM_impl &) = delete; virtual ~OSRM_impl(); void RunQuery(RouteParameters &route_parameters, http::Reply &reply); @@ -56,7 +56,6 @@ class OSRM_impl private: void RegisterPlugin(BasePlugin *plugin); PluginMap plugin_map; - ServerPaths server_paths; bool use_shared_memory; SharedBarriers *barrier; // base class pointer to the objects