Merge branch 'libosrm' of https://github.com/DennisOSRM/Project-OSRM into libosrm
This commit is contained in:
commit
80b9afc14d
@ -21,6 +21,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include "OSRM.h"
|
#include "OSRM.h"
|
||||||
|
|
||||||
OSRM::OSRM(const char * server_ini_path) {
|
OSRM::OSRM(const char * server_ini_path) {
|
||||||
|
if( !testDataFile(server_ini_path) ){
|
||||||
|
throw OSRMException("server.ini not found");
|
||||||
|
}
|
||||||
|
|
||||||
BaseConfiguration serverConfig(server_ini_path);
|
BaseConfiguration serverConfig(server_ini_path);
|
||||||
objects = new QueryObjectsStorage(
|
objects = new QueryObjectsStorage(
|
||||||
serverConfig.GetParameter("hsgrData"),
|
serverConfig.GetParameter("hsgrData"),
|
||||||
|
@ -31,15 +31,26 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include "../Plugins/ViaRoutePlugin.h"
|
#include "../Plugins/ViaRoutePlugin.h"
|
||||||
#include "../Plugins/RouteParameters.h"
|
#include "../Plugins/RouteParameters.h"
|
||||||
#include "../Util/BaseConfiguration.h"
|
#include "../Util/BaseConfiguration.h"
|
||||||
|
#include "../Util/InputFileUtil.h"
|
||||||
#include "../Server/BasicDatastructures.h"
|
#include "../Server/BasicDatastructures.h"
|
||||||
|
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class OSRMException: public std::exception {
|
||||||
|
public:
|
||||||
|
OSRMException(const char * message) : message(message) {}
|
||||||
|
private:
|
||||||
|
virtual const char* what() const throw() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
const char * message;
|
||||||
|
};
|
||||||
|
|
||||||
class OSRM : boost::noncopyable {
|
class OSRM : boost::noncopyable {
|
||||||
typedef boost::unordered_map<std::string, BasePlugin *> PluginMap;
|
typedef boost::unordered_map<std::string, BasePlugin *> PluginMap;
|
||||||
QueryObjectsStorage * objects;
|
QueryObjectsStorage * objects;
|
||||||
|
Loading…
Reference in New Issue
Block a user