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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user