From 7234fe326d16d6bf9f4374a09ddc6ef790e6723f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 18 Jun 2009 22:03:02 +0200 Subject: Globale Variablen durch Application-Klasse ersetzt --- .../RequestHandlers/SimpleRequestHandlerGroup.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/Common/RequestHandlers/SimpleRequestHandlerGroup.h') diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h index 86009f3..32e46ce 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h @@ -28,11 +28,24 @@ namespace RequestHandlers { class SimpleRequestHandlerGroup : public RequestHandlerGroup { private: + class GroupRequestHandler : public RequestHandler { + private: + std::string type; + boost::function3, XmlPacket*, Connection*> handler; + + protected: + virtual void handlePacket(boost::shared_ptr packet); + + public: + GroupRequestHandler(Application *application, const std::string &type0, const boost::function3, XmlPacket*, Connection*> &handler0) + : RequestHandler(application), type(type0), handler(handler0) {} + }; + std::set types; - std::map, XmlPacket*> > handlers; + std::map, XmlPacket*, Connection*> > handlers; protected: - void registerHandler(const std::string &type, const boost::function2, XmlPacket*> &handler) { + void registerHandler(const std::string &type, const boost::function3, XmlPacket*, Connection*> &handler) { types.insert(type); handlers.insert(std::make_pair(type, handler)); } @@ -44,7 +57,7 @@ class SimpleRequestHandlerGroup : public RequestHandlerGroup { return types; } - virtual boost::shared_ptr createRequestHandler(const std::string &type); + virtual boost::shared_ptr createRequestHandler(Application *application, const std::string &type); }; } -- cgit v1.2.3