Hashtable does not allocate during operator[], RouteParameters to

plugins are passed as ref and not as value.
This commit is contained in:
DennisOSRM
2011-12-28 14:14:09 +01:00
parent 738c3eae91
commit 5c10d2fae0
6 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ public:
virtual ~BasePlugin() { }
virtual std::string GetDescriptor() = 0;
virtual std::string GetVersionString() = 0;
virtual void HandleRequest(RouteParameters routeParameters, http::Reply& reply) = 0;
virtual void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) = 0;
};
#endif /* BASEPLUGIN_H_ */
+1 -1
View File
@@ -18,7 +18,7 @@ public:
HelloWorldPlugin() {}
virtual ~HelloWorldPlugin() { /*std::cout << GetDescriptor() << " destructor" << std::endl;*/ }
std::string GetDescriptor() { return std::string("hello"); }
void HandleRequest(RouteParameters routeParameters, http::Reply& reply) {
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
std::cout << "[hello world]: runnning handler" << std::endl;
reply.status = http::Reply::ok;
reply.content.append("<html><head><title>Hello World Demonstration Document</title></head><body><h1>Hello, World!</h1>");
+1 -1
View File
@@ -39,7 +39,7 @@ public:
}
std::string GetDescriptor() { return std::string("locate"); }
std::string GetVersionString() { return std::string("0.3 (DL)"); }
void HandleRequest(RouteParameters routeParameters, http::Reply& reply) {
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
//check number of parameters
if(routeParameters.parameters.size() != 2) {
reply = http::Reply::stockReply(http::Reply::badRequest);
+1 -1
View File
@@ -45,7 +45,7 @@ public:
}
std::string GetDescriptor() { return std::string("nearest"); }
std::string GetVersionString() { return std::string("0.3 (DL)"); }
void HandleRequest(RouteParameters routeParameters, http::Reply& reply) {
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
//check number of parameters
if(routeParameters.parameters.size() != 2) {
reply = http::Reply::stockReply(http::Reply::badRequest);
+1 -1
View File
@@ -70,7 +70,7 @@ public:
std::string GetDescriptor() { return pluginDescriptorString; }
std::string GetVersionString() { return std::string("0.3 (DL)"); }
void HandleRequest(RouteParameters routeParameters, http::Reply& reply) {
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
//check number of parameters
if(0 == routeParameters.options["start"].size() || 0 == routeParameters.options["dest"].size() ) {
reply = http::Reply::stockReply(http::Reply::badRequest);