Const'ed read-only functions in BasePlugin and derived classes.
This commit is contained in:
parent
5c10d2fae0
commit
d2b5b8d854
@ -33,8 +33,8 @@ public:
|
|||||||
BasePlugin() { }
|
BasePlugin() { }
|
||||||
//Maybe someone can explain the pure virtual destructor thing to me (dennis)
|
//Maybe someone can explain the pure virtual destructor thing to me (dennis)
|
||||||
virtual ~BasePlugin() { }
|
virtual ~BasePlugin() { }
|
||||||
virtual std::string GetDescriptor() = 0;
|
virtual std::string GetDescriptor() const = 0;
|
||||||
virtual std::string GetVersionString() = 0;
|
virtual std::string GetVersionString() const = 0 ;
|
||||||
virtual void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) = 0;
|
virtual void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,9 @@ class HelloWorldPlugin : public BasePlugin {
|
|||||||
public:
|
public:
|
||||||
HelloWorldPlugin() {}
|
HelloWorldPlugin() {}
|
||||||
virtual ~HelloWorldPlugin() { /*std::cout << GetDescriptor() << " destructor" << std::endl;*/ }
|
virtual ~HelloWorldPlugin() { /*std::cout << GetDescriptor() << " destructor" << std::endl;*/ }
|
||||||
std::string GetDescriptor() { return std::string("hello"); }
|
std::string GetDescriptor() const { return std::string("hello"); }
|
||||||
|
std::string GetVersionString() const { return std::string("0.1a"); }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
|
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
|
||||||
std::cout << "[hello world]: runnning handler" << std::endl;
|
std::cout << "[hello world]: runnning handler" << std::endl;
|
||||||
reply.status = http::Reply::ok;
|
reply.status = http::Reply::ok;
|
||||||
@ -36,7 +38,6 @@ public:
|
|||||||
reply.content.append(content.str());
|
reply.content.append(content.str());
|
||||||
reply.content.append("</body></html>");
|
reply.content.append("</body></html>");
|
||||||
}
|
}
|
||||||
std::string GetVersionString() { return std::string("0.1a"); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HELLOWORLDPLUGIN_H_ */
|
#endif /* HELLOWORLDPLUGIN_H_ */
|
||||||
|
@ -37,8 +37,8 @@ public:
|
|||||||
LocatePlugin(ObjectsForQueryStruct * objects) {
|
LocatePlugin(ObjectsForQueryStruct * objects) {
|
||||||
nodeHelpDesk = objects->nodeHelpDesk;
|
nodeHelpDesk = objects->nodeHelpDesk;
|
||||||
}
|
}
|
||||||
std::string GetDescriptor() { return std::string("locate"); }
|
std::string GetDescriptor() const { return std::string("locate"); }
|
||||||
std::string GetVersionString() { 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) {
|
||||||
//check number of parameters
|
//check number of parameters
|
||||||
if(routeParameters.parameters.size() != 2) {
|
if(routeParameters.parameters.size() != 2) {
|
||||||
|
@ -43,8 +43,8 @@ public:
|
|||||||
descriptorTable.Set("kml", 0);
|
descriptorTable.Set("kml", 0);
|
||||||
descriptorTable.Set("json", 1);
|
descriptorTable.Set("json", 1);
|
||||||
}
|
}
|
||||||
std::string GetDescriptor() { return std::string("nearest"); }
|
std::string GetDescriptor() const { return std::string("nearest"); }
|
||||||
std::string GetVersionString() { 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) {
|
||||||
//check number of parameters
|
//check number of parameters
|
||||||
if(routeParameters.parameters.size() != 2) {
|
if(routeParameters.parameters.size() != 2) {
|
||||||
|
@ -68,8 +68,8 @@ public:
|
|||||||
DELETE( searchEngine );
|
DELETE( searchEngine );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetDescriptor() { return pluginDescriptorString; }
|
std::string GetDescriptor() const { return pluginDescriptorString; }
|
||||||
std::string GetVersionString() { 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) {
|
||||||
//check number of parameters
|
//check number of parameters
|
||||||
if(0 == routeParameters.options["start"].size() || 0 == routeParameters.options["dest"].size() ) {
|
if(0 == routeParameters.options["start"].size() || 0 == routeParameters.options["dest"].size() ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user