From aaf0fb9d12bbeb3955a2607b1533f47590759323 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 15 Oct 2013 15:44:40 +0200 Subject: [PATCH] Rework facades to accept ServerPaths object as configuration --- Library/OSRM.cpp | 15 +++------------ Library/OSRM.h | 3 +-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Library/OSRM.cpp b/Library/OSRM.cpp index 8879947be..969fd605d 100644 --- a/Library/OSRM.cpp +++ b/Library/OSRM.cpp @@ -29,23 +29,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "OSRM.h" #include -OSRM::OSRM(const char * server_ini_path, const bool use_shared_memory) { - - if( !testDataFile(server_ini_path) ){ - std::string error_message(server_ini_path); - error_message += " not found"; - throw OSRMException(error_message); - } - boost::filesystem::path base_path = boost::filesystem::absolute(server_ini_path).parent_path(); - IniFile server_config(server_ini_path); - +OSRM::OSRM( const ServerPaths & server_paths, const bool use_shared_memory ) { if( !use_shared_memory ) { query_data_facade = new InternalDataFacade( - server_config, base_path + server_paths ); } else { query_data_facade = new SharedDataFacade( - server_config, base_path + server_paths ); } diff --git a/Library/OSRM.h b/Library/OSRM.h index f9ab08a4b..6951f69a6 100644 --- a/Library/OSRM.h +++ b/Library/OSRM.h @@ -60,8 +60,7 @@ private: public: OSRM( - boost::unordered_map& paths, + const ServerPaths & paths, const bool use_shared_memory = false ); ~OSRM();