implements and fixes #997

- ServerPaths object can be populated by passing base path to OSRM
- reduces code/functionality duplication in node-OSRM
This commit is contained in:
Dennis Luxen
2014-10-08 17:01:53 +02:00
parent 5bb7e62a7c
commit b9e1d3116c
4 changed files with 113 additions and 104 deletions
+5 -2
View File
@@ -46,6 +46,7 @@ namespace boost { namespace interprocess { class named_mutex; } }
#include "../Server/DataStructures/SharedBarriers.h"
#include "../Server/DataStructures/SharedDataFacade.h"
#include "../Util/make_unique.hpp"
#include "../Util/ProgramOptions.h"
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
@@ -57,8 +58,8 @@ namespace boost { namespace interprocess { class named_mutex; } }
#include <utility>
#include <vector>
OSRM_impl::OSRM_impl(const ServerPaths &server_paths, const bool use_shared_memory)
: use_shared_memory(use_shared_memory)
OSRM_impl::OSRM_impl(const ServerPaths &paths, const bool use_shared_memory)
: server_paths(paths)
{
if (use_shared_memory)
{
@@ -67,6 +68,8 @@ OSRM_impl::OSRM_impl(const ServerPaths &server_paths, const bool use_shared_memo
}
else
{
// populate base path
populate_base_path(server_paths);
query_data_facade = new InternalDataFacade<QueryEdge::EdgeData>(server_paths);
}
+1
View File
@@ -56,6 +56,7 @@ 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