First implementation of moving the algorithmic core into a library

This commit is contained in:
Dennis Luxen 2013-06-26 19:48:02 -04:00
parent bfef8f39b7
commit 2c397bfa0b
19 changed files with 143 additions and 139 deletions

View File

@ -21,6 +21,9 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef BASEPARSER_H_ #ifndef BASEPARSER_H_
#define BASEPARSER_H_ #define BASEPARSER_H_
#include "ExtractorCallbacks.h"
#include "ScriptingEnvironment.h"
extern "C" { extern "C" {
#include <lua.h> #include <lua.h>
#include <lauxlib.h> #include <lauxlib.h>
@ -29,9 +32,6 @@ extern "C" {
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include "ExtractorCallbacks.h"
#include "ScriptingEnvironment.h"
class BaseParser : boost::noncopyable { class BaseParser : boost::noncopyable {
public: public:
BaseParser(ExtractorCallbacks* ec, ScriptingEnvironment& se); BaseParser(ExtractorCallbacks* ec, ScriptingEnvironment& se);

View File

@ -18,19 +18,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt. or see http://www.gnu.org/licenses/agpl.txt.
*/ */
#ifndef EXTRACTIONHELPERFUNCTIONS_H_ #ifndef EXTRACTIONHELPERFUNCTIONS_H_
#define EXTRACTIONHELPERFUNCTIONS_H_ #define EXTRACTIONHELPERFUNCTIONS_H_
#include "../Util/StringUtil.h"
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp> #include <boost/algorithm/string_regex.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <climits> #include <climits>
#include "../Util/StringUtil.h"
namespace qi = boost::spirit::qi; namespace qi = boost::spirit::qi;
//TODO: Move into LUA //TODO: Move into LUA

View File

@ -40,7 +40,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "ExtractorCallbacks.h" #include "ExtractorCallbacks.h"
#include "ExtractionHelperFunctions.h"
ExtractorCallbacks::ExtractorCallbacks() {externalMemory = NULL; stringMap = NULL; } ExtractorCallbacks::ExtractorCallbacks() {externalMemory = NULL; stringMap = NULL; }
ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers * ext, StringMap * strMap) { ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers * ext, StringMap * strMap) {

View File

@ -31,6 +31,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include "ExtractionContainers.h" #include "ExtractionContainers.h"
#include "ExtractionHelperFunctions.h"
#include "ExtractorStructs.h" #include "ExtractorStructs.h"
class ExtractorCallbacks{ class ExtractorCallbacks{

View File

@ -21,13 +21,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef EXTRACTORSTRUCTS_H_ #ifndef EXTRACTORSTRUCTS_H_
#define EXTRACTORSTRUCTS_H_ #define EXTRACTORSTRUCTS_H_
#include <climits>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/regex.hpp>
#include <boost/unordered_map.hpp>
#include "../DataStructures/Coordinate.h" #include "../DataStructures/Coordinate.h"
#include "../DataStructures/HashTable.h" #include "../DataStructures/HashTable.h"
@ -37,6 +30,14 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "../DataStructures/TimingUtil.h" #include "../DataStructures/TimingUtil.h"
#include "../typedefs.h" #include "../typedefs.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/regex.hpp>
#include <boost/unordered_map.hpp>
#include <climits>
#include <string>
typedef boost::unordered_map<std::string, NodeID > StringMap; typedef boost::unordered_map<std::string, NodeID > StringMap;
typedef boost::unordered_map<std::string, std::pair<int, short> > StringToIntPairMap; typedef boost::unordered_map<std::string, std::pair<int, short> > StringToIntPairMap;

View File

@ -21,13 +21,14 @@
#ifndef PBFPARSER_H_ #ifndef PBFPARSER_H_
#define PBFPARSER_H_ #define PBFPARSER_H_
#include "BaseParser.h"
#include "../DataStructures/HashTable.h" #include "../DataStructures/HashTable.h"
#include "../DataStructures/ConcurrentQueue.h" #include "../DataStructures/ConcurrentQueue.h"
#include "../Util/MachineInfo.h" #include "../Util/MachineInfo.h"
#include "../Util/OpenMPWrapper.h" #include "../Util/OpenMPWrapper.h"
#include "../typedefs.h" #include "../typedefs.h"
#include "BaseParser.h"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <boost/ref.hpp> #include <boost/ref.hpp>
@ -37,8 +38,6 @@
#include <zlib.h> #include <zlib.h>
class PBFParser : public BaseParser { class PBFParser : public BaseParser {
enum EntityType { enum EntityType {

View File

@ -21,20 +21,14 @@
#ifndef SCRIPTINGENVIRONMENT_H_ #ifndef SCRIPTINGENVIRONMENT_H_
#define SCRIPTINGENVIRONMENT_H_ #define SCRIPTINGENVIRONMENT_H_
extern "C" {
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <luabind/luabind.hpp>
#include "ExtractionHelperFunctions.h" #include "ExtractionHelperFunctions.h"
#include "ExtractorStructs.h" #include "ExtractorStructs.h"
#include "../typedefs.h"
#include "../DataStructures/ImportNode.h" #include "../DataStructures/ImportNode.h"
#include "../Util/LuaUtil.h" #include "../Util/LuaUtil.h"
#include "../Util/OpenMPWrapper.h" #include "../Util/OpenMPWrapper.h"
#include "../typedefs.h"
#include <vector>
class ScriptingEnvironment { class ScriptingEnvironment {
public: public:

View File

@ -18,14 +18,13 @@
or see http://www.gnu.org/licenses/agpl.txt. or see http://www.gnu.org/licenses/agpl.txt.
*/ */
#include <boost/ref.hpp>
#include "XMLParser.h" #include "XMLParser.h"
#include "ExtractorStructs.h" #include "ExtractorStructs.h"
#include "../DataStructures/HashTable.h" #include "../DataStructures/HashTable.h"
#include "../DataStructures/InputReaderFactory.h" #include "../DataStructures/InputReaderFactory.h"
#include <boost/ref.hpp>
XMLParser::XMLParser(const char * filename, ExtractorCallbacks* ec, ScriptingEnvironment& se) : BaseParser(ec, se) { XMLParser::XMLParser(const char * filename, ExtractorCallbacks* ec, ScriptingEnvironment& se) : BaseParser(ec, se) {
WARN("Parsing plain .osm/.osm.bz2 is deprecated. Switch to .pbf"); WARN("Parsing plain .osm/.osm.bz2 is deprecated. Switch to .pbf");

View File

@ -21,13 +21,12 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef BASEPLUGIN_H_ #ifndef BASEPLUGIN_H_
#define BASEPLUGIN_H_ #define BASEPLUGIN_H_
#include <cassert>
#include <string>
#include <vector>
#include "RouteParameters.h" #include "RouteParameters.h"
#include "../Server/BasicDatastructures.h" #include "../Server/BasicDatastructures.h"
#include <string>
#include <vector>
class BasePlugin { class BasePlugin {
public: public:
BasePlugin() { } BasePlugin() { }

View File

@ -8,15 +8,15 @@
#ifndef HELLOWORLDPLUGIN_H_ #ifndef HELLOWORLDPLUGIN_H_
#define HELLOWORLDPLUGIN_H_ #define HELLOWORLDPLUGIN_H_
#include <sstream>
#include "BasePlugin.h" #include "BasePlugin.h"
#include "RouteParameters.h" #include "RouteParameters.h"
#include <sstream>
class HelloWorldPlugin : public BasePlugin { class HelloWorldPlugin : public BasePlugin {
public: public:
HelloWorldPlugin() {} HelloWorldPlugin() {}
virtual ~HelloWorldPlugin() { /*std::cout << GetDescriptor() << " destructor" << std::endl;*/ } virtual ~HelloWorldPlugin() { }
std::string GetDescriptor() const { return std::string("hello"); } std::string GetDescriptor() const { return std::string("hello"); }
std::string GetVersionString() const { return std::string("0.1a"); } std::string GetVersionString() const { return std::string("0.1a"); }

View File

@ -21,16 +21,15 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef NearestPlugin_H_ #ifndef NearestPlugin_H_
#define NearestPlugin_H_ #define NearestPlugin_H_
#include <fstream>
#include "BasePlugin.h" #include "BasePlugin.h"
#include "RouteParameters.h" #include "RouteParameters.h"
#include "../Server/DataStructures/QueryObjectsStorage.h"
#include "../DataStructures/NodeInformationHelpDesk.h" #include "../DataStructures/NodeInformationHelpDesk.h"
#include "../Server/DataStructures/QueryObjectsStorage.h"
#include "../Util/StringUtil.h" #include "../Util/StringUtil.h"
#include <fstream>
/* /*
* This Plugin locates the nearest point on a street in the road network for a given coordinate. * This Plugin locates the nearest point on a street in the road network for a given coordinate.
*/ */

View File

@ -21,15 +21,25 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef ROUTE_PARAMETERS_H #ifndef ROUTE_PARAMETERS_H
#define ROUTE_PARAMETERS_H #define ROUTE_PARAMETERS_H
#include "../DataStructures/Coordinate.h"
#include "../DataStructures/HashTable.h"
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/sequence/intrinsic.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/fusion/sequence/intrinsic.hpp>
#include "../DataStructures/Coordinate.h"
struct RouteParameters { struct RouteParameters {
RouteParameters() : zoomLevel(18), printInstructions(false), alternateRoute(true), geometry(true), compression(true), deprecatedAPI(false), checkSum(-1) {} RouteParameters() :
zoomLevel(18),
printInstructions(false),
alternateRoute(true),
geometry(true),
compression(true),
deprecatedAPI(false),
checkSum(-1) {}
short zoomLevel; short zoomLevel;
bool printInstructions; bool printInstructions;
bool alternateRoute; bool alternateRoute;

View File

@ -21,18 +21,22 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef TIMESTAMPPLUGIN_H_ #ifndef TIMESTAMPPLUGIN_H_
#define TIMESTAMPPLUGIN_H_ #define TIMESTAMPPLUGIN_H_
#include <cassert>
#include "BasePlugin.h" #include "BasePlugin.h"
#include "RouteParameters.h" #include "RouteParameters.h"
#include <cassert>
class TimestampPlugin : public BasePlugin { class TimestampPlugin : public BasePlugin {
public: public:
TimestampPlugin(QueryObjectsStorage * o) : objects(o) { TimestampPlugin(QueryObjectsStorage * o) : objects(o) {
} }
~TimestampPlugin() {
std::cout << "shutdown time stamp" << std::endl;
}
std::string GetDescriptor() const { return std::string("timestamp"); } std::string GetDescriptor() const { return std::string("timestamp"); }
std::string GetVersionString() const { return std::string("0.3 (DL)"); } std::string GetVersionString() const { return std::string("0.3 (DL)"); }
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) { void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
std::cout << "handling request" << std::endl;
std::string tmp; std::string tmp;
//json //json

View File

@ -21,29 +21,26 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef VIAROUTEPLUGIN_H_ #ifndef VIAROUTEPLUGIN_H_
#define VIAROUTEPLUGIN_H_ #define VIAROUTEPLUGIN_H_
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include "BasePlugin.h" #include "BasePlugin.h"
#include "RouteParameters.h" #include "RouteParameters.h"
#include "../Algorithms/ObjectToBase64.h" #include "../Algorithms/ObjectToBase64.h"
#include "../Descriptors/BaseDescriptor.h"
#include "../Descriptors/GPXDescriptor.h"
#include "../Descriptors/JSONDescriptor.h"
#include "../DataStructures/HashTable.h" #include "../DataStructures/HashTable.h"
#include "../DataStructures/QueryEdge.h" #include "../DataStructures/QueryEdge.h"
#include "../DataStructures/StaticGraph.h" #include "../DataStructures/StaticGraph.h"
#include "../DataStructures/SearchEngine.h" #include "../DataStructures/SearchEngine.h"
#include "../Descriptors/BaseDescriptor.h"
#include "../Descriptors/GPXDescriptor.h"
#include "../Descriptors/JSONDescriptor.h"
#include "../Server/DataStructures/QueryObjectsStorage.h"
#include "../Util/StringUtil.h" #include "../Util/StringUtil.h"
#include "../Server/DataStructures/QueryObjectsStorage.h" #include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
class ViaRoutePlugin : public BasePlugin { class ViaRoutePlugin : public BasePlugin {
private: private:

View File

@ -20,12 +20,16 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef BASIC_DATASTRUCTURES_H #ifndef BASIC_DATASTRUCTURES_H
#define BASIC_DATASTRUCTURES_H #define BASIC_DATASTRUCTURES_H
#include <string>
#include <sstream>
#include <boost/foreach.hpp>
#include "../Util/StringUtil.h" #include "../Util/StringUtil.h"
#include <boost/asio.hpp>
#include <boost/foreach.hpp>
#include <string>
#include <sstream>
#include <vector>
namespace http { namespace http {
const std::string okString = "HTTP/1.0 200 OK\r\n"; const std::string okString = "HTTP/1.0 200 OK\r\n";

View File

@ -21,7 +21,9 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef CONNECTION_H #ifndef CONNECTION_H
#define CONNECTION_H #define CONNECTION_H
#include <vector> #include "BasicDatastructures.h"
#include "RequestHandler.h"
#include "RequestParser.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
@ -30,11 +32,9 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include "BasicDatastructures.h" #include <zlib.h>
#include "RequestHandler.h"
#include "RequestParser.h"
#include "zlib.h" #include <vector>
namespace http { namespace http {

View File

@ -21,35 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef REQUEST_HANDLER_H #ifndef REQUEST_HANDLER_H
#define REQUEST_HANDLER_H #define REQUEST_HANDLER_H
#include <algorithm>
#include <cctype> // std::tolower
#include <string>
#include <iostream>
#include <boost/noncopyable.hpp>
#include "APIGrammar.h" #include "APIGrammar.h"
#include "BasicDatastructures.h" #include "BasicDatastructures.h"
#include "../DataStructures/HashTable.h" #include "../Library/OSRM.h"
#include "../Plugins/BasePlugin.h"
#include "../Plugins/RouteParameters.h" #include "../Plugins/RouteParameters.h"
#include "../Util/StringUtil.h" #include "../Util/StringUtil.h"
#include "../typedefs.h" #include "../typedefs.h"
namespace http { #include <boost/foreach.hpp>
#include <boost/noncopyable.hpp>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
class RequestHandler : private boost::noncopyable { class RequestHandler : private boost::noncopyable {
public: public:
explicit RequestHandler() : _pluginCount(0) { } typedef APIGrammar<std::string::iterator, RouteParameters> APIGrammarParser;
explicit RequestHandler() { }
~RequestHandler() { void handle_request(const http::Request& req, http::Reply& rep){
for(unsigned i = 0; i < _pluginVector.size(); i++) {
BasePlugin * tempPointer = _pluginVector[i];
delete tempPointer;
}
}
void handle_request(const Request& req, Reply& rep){
//parse command //parse command
try { try {
std::string request(req.uri); std::string request(req.uri);
@ -66,10 +58,10 @@ public:
} }
RouteParameters routeParameters; RouteParameters routeParameters;
APIGrammar<std::string::iterator, RouteParameters> apiParser(&routeParameters); APIGrammarParser apiParser(&routeParameters);
std::string::iterator it = request.begin(); std::string::iterator it = request.begin();
bool result = boost::spirit::qi::parse(it, request.end(), apiParser); // returns true if successful bool result = boost::spirit::qi::parse(it, request.end(), apiParser);
if (!result || (it != request.end()) ) { if (!result || (it != request.end()) ) {
rep = http::Reply::stockReply(http::Reply::badRequest); rep = http::Reply::stockReply(http::Reply::badRequest);
int position = std::distance(request.begin(), it); int position = std::distance(request.begin(), it);
@ -80,38 +72,29 @@ public:
rep.content += request; rep.content += request;
rep.content += tmp_position_string; rep.content += tmp_position_string;
rep.content += "<br>"; rep.content += "<br>";
for(unsigned i = 0, end = std::distance(request.begin(), it); i < end; ++i) unsigned end = std::distance(request.begin(), it);
for(unsigned i = 0; i < end; ++i) {
rep.content += "&nbsp;"; rep.content += "&nbsp;";
}
rep.content += "^<br></pre>"; rep.content += "^<br></pre>";
} else { } else {
//Finished parsing, lets call the right plugin to handle the request //parsing done, lets call the right plugin to handle the request
if(pluginMap.Holds(routeParameters.service)) { routing_machine->RunQuery(routeParameters, rep);
rep.status = Reply::ok;
_pluginVector[pluginMap.Find(routeParameters.service)]->HandleRequest(routeParameters, rep );
} else {
rep = Reply::stockReply(Reply::badRequest);
}
return; return;
} }
} catch(std::exception& e) { } catch(std::exception& e) {
rep = Reply::stockReply(Reply::internalServerError); rep = http::Reply::stockReply(http::Reply::internalServerError);
std::cerr << "[server error] code: " << e.what() << ", uri: " << req.uri << std::endl; WARN("[server error] code: " << e.what() << ", uri: " << req.uri);
return; return;
} }
}; };
void RegisterPlugin(BasePlugin * plugin) { void RegisterRoutingMachine(OSRM * osrm) {
std::cout << "[handler] registering plugin " << plugin->GetDescriptor() << std::endl; routing_machine = osrm;
pluginMap.Add(plugin->GetDescriptor(), _pluginCount);
_pluginVector.push_back(plugin);
++_pluginCount;
} }
private: private:
HashTable<std::string, unsigned> pluginMap; OSRM * routing_machine;
std::vector<BasePlugin *> _pluginVector;
unsigned _pluginCount;
}; };
} // namespace http
#endif // REQUEST_HANDLER_H #endif // REQUEST_HANDLER_H

View File

@ -21,21 +21,29 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef SERVER_H #ifndef SERVER_H
#define SERVER_H #define SERVER_H
#include <vector> #include "Connection.h"
#include "RequestHandler.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include "Connection.h" #include <vector>
#include "RequestHandler.h"
namespace http {
class Server: private boost::noncopyable { class Server: private boost::noncopyable {
public: public:
explicit Server(const std::string& address, const std::string& port, unsigned thread_pool_size) : threadPoolSize(thread_pool_size), acceptor(ioService), newConnection(new Connection(ioService, requestHandler)), requestHandler(){ explicit Server(
const std::string& address,
const std::string& port,
unsigned thread_pool_size
) :
threadPoolSize(thread_pool_size),
acceptor(ioService),
newConnection(new http::Connection(ioService, requestHandler)),
requestHandler()
{
boost::asio::ip::tcp::resolver resolver(ioService); boost::asio::ip::tcp::resolver resolver(ioService);
boost::asio::ip::tcp::resolver::query query(address, port); boost::asio::ip::tcp::resolver::query query(address, port);
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
@ -44,7 +52,14 @@ public:
acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
acceptor.bind(endpoint); acceptor.bind(endpoint);
acceptor.listen(); acceptor.listen();
acceptor.async_accept(newConnection->socket(), boost::bind(&Server::handleAccept, this, boost::asio::placeholders::error)); acceptor.async_accept(
newConnection->socket(),
boost::bind(
&Server::handleAccept,
this,
boost::asio::placeholders::error
)
);
} }
void Run() { void Run() {
@ -66,23 +81,28 @@ public:
} }
private: private:
typedef boost::shared_ptr<Connection > ConnectionPtr;
void handleAccept(const boost::system::error_code& e) { void handleAccept(const boost::system::error_code& e) {
if (!e) { if (!e) {
newConnection->start(); newConnection->start();
newConnection.reset(new Connection(ioService, requestHandler)); newConnection.reset(
acceptor.async_accept(newConnection->socket(), boost::bind(&Server::handleAccept, this, boost::asio::placeholders::error)); new http::Connection(ioService, requestHandler)
);
acceptor.async_accept(
newConnection->socket(),
boost::bind(
&Server::handleAccept,
this,
boost::asio::placeholders::error
)
);
} }
} }
unsigned threadPoolSize; unsigned threadPoolSize;
boost::asio::io_service ioService; boost::asio::io_service ioService;
boost::asio::ip::tcp::acceptor acceptor; boost::asio::ip::tcp::acceptor acceptor;
ConnectionPtr newConnection; boost::shared_ptr<http::Connection> newConnection;
RequestHandler requestHandler; RequestHandler requestHandler;
}; };
} // namespace http
#endif // SERVER_H #endif // SERVER_H

View File

@ -25,21 +25,19 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef SERVERFACTORY_H_ #ifndef SERVERFACTORY_H_
#define SERVERFACTORY_H_ #define SERVERFACTORY_H_
#include <zlib.h>
#include "Server.h" #include "Server.h"
#include "ServerConfiguration.h"
#include "../Util/BaseConfiguration.h"
#include "../Util/InputFileUtil.h" #include "../Util/InputFileUtil.h"
#include "../Util/OpenMPWrapper.h" #include "../Util/OpenMPWrapper.h"
#include "../Util/StringUtil.h" #include "../Util/StringUtil.h"
#include "../typedefs.h" #include "../typedefs.h"
typedef http::Server Server; #include <zlib.h>
struct ServerFactory { struct ServerFactory {
static Server * CreateServer(ServerConfiguration& serverConfig) { static Server * CreateServer(BaseConfiguration& serverConfig) {
if(!testDataFile(serverConfig.GetParameter("nodesData"))) { if(!testDataFile(serverConfig.GetParameter("nodesData"))) {
ERR("nodes file not found"); ERR("nodes file not found");
@ -76,7 +74,7 @@ struct ServerFactory {
} }
static Server * CreateServer(const char * iniFile) { static Server * CreateServer(const char * iniFile) {
ServerConfiguration serverConfig(iniFile); BaseConfiguration serverConfig(iniFile);
return CreateServer(serverConfig); return CreateServer(serverConfig);
} }
}; };