Order ServerPaths members by memory size, pass ServerPaths by ref
This commit is contained in:
parent
598f5519d1
commit
12f2acc9ff
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2014, Project OSRM, Dennis Luxen, others
|
Copyright (c) 2015, Project OSRM, Dennis Luxen, others
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@ -33,19 +33,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
struct ServerConfig
|
struct ServerConfig
|
||||||
{
|
{
|
||||||
ServerConfig()
|
ServerConfig()
|
||||||
: use_shared_memory(false)
|
: max_locations_distance_table(100)
|
||||||
, max_locations_distance_table(100)
|
, use_shared_memory(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ServerConfig(const ServerPaths paths, const bool flag, const int max)
|
ServerConfig(const ServerPaths &paths, const bool flag, const int max)
|
||||||
: server_paths(paths)
|
: server_paths(paths)
|
||||||
, use_shared_memory(flag)
|
|
||||||
, max_locations_distance_table(max)
|
, max_locations_distance_table(max)
|
||||||
|
, use_shared_memory(flag)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ServerPaths server_paths;
|
ServerPaths server_paths;
|
||||||
bool use_shared_memory;
|
|
||||||
int max_locations_distance_table;
|
int max_locations_distance_table;
|
||||||
|
bool use_shared_memory;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SERVER_CONFIG_H
|
#endif // SERVER_CONFIG_H
|
||||||
|
@ -57,7 +57,7 @@ namespace boost { namespace interprocess { class named_mutex; } }
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
OSRM_impl::OSRM_impl(ServerConfig serverConfig)
|
OSRM_impl::OSRM_impl(ServerConfig &serverConfig)
|
||||||
{
|
{
|
||||||
if (serverConfig.use_shared_memory)
|
if (serverConfig.use_shared_memory)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ class OSRM_impl
|
|||||||
using PluginMap = std::unordered_map<std::string, BasePlugin *>;
|
using PluginMap = std::unordered_map<std::string, BasePlugin *>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OSRM_impl(ServerConfig serverConfig);
|
OSRM_impl(ServerConfig &serverConfig);
|
||||||
OSRM_impl(const OSRM_impl &) = delete;
|
OSRM_impl(const OSRM_impl &) = delete;
|
||||||
virtual ~OSRM_impl();
|
virtual ~OSRM_impl();
|
||||||
void RunQuery(RouteParameters &route_parameters, http::Reply &reply);
|
void RunQuery(RouteParameters &route_parameters, http::Reply &reply);
|
||||||
|
@ -278,7 +278,7 @@ inline unsigned GenerateServerProgramOptions(const int argc,
|
|||||||
}
|
}
|
||||||
if (1 > max_locations_distance_table)
|
if (1 > max_locations_distance_table)
|
||||||
{
|
{
|
||||||
throw OSRMException("Max location for distance table must be a positive number");
|
throw osrm::exception("Max location for distance table must be a positive number");
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleLogger().Write() << visible_options;
|
SimpleLogger().Write() << visible_options;
|
||||||
|
Loading…
Reference in New Issue
Block a user