renamed: Include/osrm/ServerConfig.h -> Include/osrm/libosrm_config.hpp

pass lib config object by reference
This commit is contained in:
Dennis Luxen
2015-01-08 15:05:54 +01:00
parent 48b131eb5c
commit c6bb7c5993
6 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef OSRM_H
#define OSRM_H
#include <osrm/ServerConfig.h>
#include <osrm/libosrm_config.hpp>
#include <memory>
@@ -46,7 +46,7 @@ class OSRM
std::unique_ptr<OSRM_impl> OSRM_pimpl_;
public:
explicit OSRM(ServerConfig serverConfig);
explicit OSRM(libosrm_config &lib_config);
~OSRM();
int RunQuery(RouteParameters &route_parameters, JSON::Object &json_result);
};
+7 -7
View File
@@ -55,9 +55,9 @@ namespace boost { namespace interprocess { class named_mutex; } }
#include <utility>
#include <vector>
OSRM_impl::OSRM_impl(ServerConfig &serverConfig)
OSRM_impl::OSRM_impl(libosrm_config &lib_config)
{
if (serverConfig.use_shared_memory)
if (lib_config.use_shared_memory)
{
barrier = osrm::make_unique<SharedBarriers>();
query_data_facade = new SharedDataFacade<QueryEdge::EdgeData>();
@@ -65,13 +65,13 @@ OSRM_impl::OSRM_impl(ServerConfig &serverConfig)
else
{
// populate base path
populate_base_path(serverConfig.server_paths);
query_data_facade = new InternalDataFacade<QueryEdge::EdgeData>(serverConfig.server_paths);
populate_base_path(lib_config.server_paths);
query_data_facade = new InternalDataFacade<QueryEdge::EdgeData>(lib_config.server_paths);
}
// The following plugins handle all requests.
RegisterPlugin(new DistanceTablePlugin<BaseDataFacade<QueryEdge::EdgeData>>(query_data_facade,
serverConfig.max_locations_distance_table));
lib_config.max_locations_distance_table));
RegisterPlugin(new HelloWorldPlugin());
RegisterPlugin(new LocatePlugin<BaseDataFacade<QueryEdge::EdgeData>>(query_data_facade));
RegisterPlugin(new NearestPlugin<BaseDataFacade<QueryEdge::EdgeData>>(query_data_facade));
@@ -151,8 +151,8 @@ int OSRM_impl::RunQuery(RouteParameters &route_parameters, JSON::Object &json_re
// proxy code for compilation firewall
OSRM::OSRM(ServerConfig server_config)
: OSRM_pimpl_(osrm::make_unique<OSRM_impl>(server_config))
OSRM::OSRM(libosrm_config &lib_config)
: OSRM_pimpl_(osrm::make_unique<OSRM_impl>(lib_config))
{
}
+2 -2
View File
@@ -35,7 +35,7 @@ struct RouteParameters;
#include "../data_structures/query_edge.hpp"
#include <osrm/json_container.hpp>
#include <osrm/ServerConfig.h>
#include <osrm/libosrm_config.hpp>
#include <memory>
#include <unordered_map>
@@ -50,7 +50,7 @@ class OSRM_impl
using PluginMap = std::unordered_map<std::string, BasePlugin *>;
public:
OSRM_impl(ServerConfig &serverConfig);
OSRM_impl(libosrm_config &lib_config);
OSRM_impl(const OSRM_impl &) = delete;
virtual ~OSRM_impl();
int RunQuery(RouteParameters &route_parameters, JSON::Object &json_result);