Merge branch 'libosrm' of https://github.com/DennisOSRM/Project-OSRM into libosrm

This commit is contained in:
DennisOSRM 2013-07-08 15:10:43 +02:00
commit 80b9afc14d
2 changed files with 16 additions and 1 deletions

View File

@ -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"),

View File

@ -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;