From dc934629919bdcaea72c78e5291263914fb958ec Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 May 2009 20:05:46 +0000 Subject: svn merge -r113003:119136 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-2 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-3 --- indra/llmessage/llareslistener.h | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 indra/llmessage/llareslistener.h (limited to 'indra/llmessage/llareslistener.h') diff --git a/indra/llmessage/llareslistener.h b/indra/llmessage/llareslistener.h new file mode 100644 index 0000000000..8835440c5d --- /dev/null +++ b/indra/llmessage/llareslistener.h @@ -0,0 +1,47 @@ +/** + * @file llareslistener.h + * @author Nat Goodspeed + * @date 2009-03-18 + * @brief LLEventPump API for LLAres. This header doesn't actually define the + * API; the API is defined by the pump name on which this class + * listens, and by the expected content of LLSD it receives. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLARESLISTENER_H) +#define LL_LLARESLISTENER_H + +#include +#include +#include +#include "llevents.h" + +class LLAres; +class LLSD; + +/// Listen on an LLEventPump with specified name for LLAres request events. +class LLAresListener +{ +public: + /// Specify the pump name on which to listen, and bind the LLAres instance + /// to use (e.g. gAres) + LLAresListener(const std::string& pumpname, LLAres* llares); + + /// Handle request events on the event pump specified at construction time + bool process(const LLSD& command); + +private: + /// command["op"] == "rewriteURI" + void rewriteURI(const LLSD& data); + + typedef boost::function Callable; + typedef std::map DispatchMap; + DispatchMap mDispatch; + LLTempBoundListener mBoundListener; + LLAres* mAres; +}; + +#endif /* ! defined(LL_LLARESLISTENER_H) */ -- cgit v1.2.3 From dc3833f31b8a20220ddb1775e1625c016c397435 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 19 Jun 2009 00:17:30 +0000 Subject: DEV-31980: extract dispatch-by-string-name logic from LLAresListener to new LLEventDispatcher and LLDispatchListener classes. See LLAresListener for example usage. --- indra/llmessage/llareslistener.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'indra/llmessage/llareslistener.h') diff --git a/indra/llmessage/llareslistener.h b/indra/llmessage/llareslistener.h index 8835440c5d..bf093b3d3d 100644 --- a/indra/llmessage/llareslistener.h +++ b/indra/llmessage/llareslistener.h @@ -14,33 +14,23 @@ #if ! defined(LL_LLARESLISTENER_H) #define LL_LLARESLISTENER_H -#include -#include -#include -#include "llevents.h" +#include "lleventdispatcher.h" class LLAres; class LLSD; /// Listen on an LLEventPump with specified name for LLAres request events. -class LLAresListener +class LLAresListener: public LLDispatchListener { public: /// Specify the pump name on which to listen, and bind the LLAres instance /// to use (e.g. gAres) LLAresListener(const std::string& pumpname, LLAres* llares); - /// Handle request events on the event pump specified at construction time - bool process(const LLSD& command); - private: /// command["op"] == "rewriteURI" void rewriteURI(const LLSD& data); - typedef boost::function Callable; - typedef std::map DispatchMap; - DispatchMap mDispatch; - LLTempBoundListener mBoundListener; LLAres* mAres; }; -- cgit v1.2.3