Rework facades to accept ServerPaths object as configuration
This commit is contained in:
parent
02e9f8aef3
commit
aaf0fb9d12
@ -29,23 +29,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "OSRM.h"
|
#include "OSRM.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
OSRM::OSRM(const char * server_ini_path, const bool use_shared_memory) {
|
OSRM::OSRM( const ServerPaths & server_paths, 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);
|
|
||||||
|
|
||||||
if( !use_shared_memory ) {
|
if( !use_shared_memory ) {
|
||||||
query_data_facade = new InternalDataFacade<QueryEdge::EdgeData>(
|
query_data_facade = new InternalDataFacade<QueryEdge::EdgeData>(
|
||||||
server_config, base_path
|
server_paths
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
query_data_facade = new SharedDataFacade<QueryEdge::EdgeData>(
|
query_data_facade = new SharedDataFacade<QueryEdge::EdgeData>(
|
||||||
server_config, base_path
|
server_paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +60,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
OSRM(
|
OSRM(
|
||||||
boost::unordered_map<const std::string,
|
const ServerPaths & paths,
|
||||||
boost::filesystem::path>& paths,
|
|
||||||
const bool use_shared_memory = false
|
const bool use_shared_memory = false
|
||||||
);
|
);
|
||||||
~OSRM();
|
~OSRM();
|
||||||
|
Loading…
Reference in New Issue
Block a user