do not instantiate shared memory facility in routed, fixes #905 and #910

This commit is contained in:
Dennis Luxen
2014-02-11 11:35:29 +01:00
parent 45a4fe44f7
commit 7794cd6274
4 changed files with 64 additions and 19 deletions
+13 -7
View File
@@ -25,13 +25,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NearestPlugin_H_
#define NearestPlugin_H_
#ifndef NEAREST_PLUGIN_H
#define NEAREST_PLUGIN_H
#include "BasePlugin.h"
#include "../DataStructures/PhantomNodes.h"
#include "../Util/StringUtil.h"
#include <boost/unordered_map.hpp>
/*
* This Plugin locates the nearest point on a street in the road network for a given coordinate.
*/
@@ -44,11 +46,15 @@ public:
facade(facade),
descriptor_string("nearest")
{
descriptorTable.insert(std::make_pair("" , 0)); //default descriptor
descriptorTable.insert(std::make_pair("json", 1));
descriptorTable.emplace("", 0); //default descriptor
descriptorTable.emplace("json", 1);
}
const std::string & GetDescriptor() const { return descriptor_string; }
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
void HandleRequest(
const RouteParameters & routeParameters,
http::Reply& reply
) {
//check number of parameters
if(!routeParameters.coordinates.size()) {
reply = http::Reply::StockReply(http::Reply::badRequest);
@@ -119,8 +125,8 @@ public:
private:
DataFacadeT * facade;
HashTable<std::string, unsigned> descriptorTable;
boost::unordered_map<std::string, unsigned> descriptorTable;
std::string descriptor_string;
};
#endif /* NearestPlugin_H_ */
#endif /* NEAREST_PLUGIN_H */