minor adjustments

This commit is contained in:
Dennis Luxen 2011-07-12 14:17:21 +00:00
parent 83b5774d1a
commit 307c9ae9c5

View File

@ -36,21 +36,21 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "Plugins/LocatePlugin.h" #include "Plugins/LocatePlugin.h"
#include "Plugins/NearestPlugin.h" #include "Plugins/NearestPlugin.h"
#include "Plugins/RoutePlugin.h" #include "Plugins/RoutePlugin.h"
#include "Plugins/ViaRoutePlugin.h"
#include "Util/InputFileUtil.h" #include "Util/InputFileUtil.h"
using namespace std; using namespace std;
typedef http::RequestHandler RequestHandler; typedef http::RequestHandler RequestHandler;
int main (int argc, char *argv[]) int main (int argc, char *argv[]) {
{
if(testDataFiles(argc, argv)==false) { if(testDataFiles(argc, argv)==false) {
std::cerr << "[error] at least one data file name seems to be bogus!" << std::endl; std::cerr << "[error] at least one data file name seems to be bogus!" << std::endl;
exit(-1); exit(-1);
} }
try { try {
std::cout << "[server] starting up engines, compiled at " << __TIMESTAMP__ << std::endl; std::cout << "[server] starting up engines, saved at " << __TIMESTAMP__ << std::endl;
int sig = 0; int sig = 0;
sigset_t new_mask; sigset_t new_mask;
sigset_t old_mask; sigset_t old_mask;
@ -67,17 +67,15 @@ int main (int argc, char *argv[])
serverConfig.GetParameter("nodesData"), serverConfig.GetParameter("nodesData"),
serverConfig.GetParameter("namesData")); serverConfig.GetParameter("namesData"));
BasePlugin * helloWorld = new HelloWorldPlugin(); h.RegisterPlugin(new HelloWorldPlugin());
h.RegisterPlugin(helloWorld);
BasePlugin * locate = new LocatePlugin(objects); h.RegisterPlugin(new LocatePlugin(objects));
h.RegisterPlugin(locate);
BasePlugin * nearest = new NearestPlugin(objects); h.RegisterPlugin(new NearestPlugin(objects));
h.RegisterPlugin(nearest);
BasePlugin * route = new RoutePlugin(objects); h.RegisterPlugin(new RoutePlugin(objects));
h.RegisterPlugin(route);
h.RegisterPlugin(new ViaRoutePlugin(objects));
boost::thread t(boost::bind(&Server::Run, s)); boost::thread t(boost::bind(&Server::Run, s));
@ -93,8 +91,8 @@ int main (int argc, char *argv[])
std::cout << std::endl << "[server] shutting down" << std::endl; std::cout << std::endl << "[server] shutting down" << std::endl;
s->Stop(); s->Stop();
t.join(); t.join();
delete s; DELETE(s);
delete objects; DELETE(objects);
} catch (std::exception& e) { } catch (std::exception& e) {
std::cerr << "[fatal error] exception: " << e.what() << std::endl; std::cerr << "[fatal error] exception: " << e.what() << std::endl;
} }