From 2f97829aab549a4d65daead298361a0c25399be2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 12 Nov 2009 20:11:53 -0500 Subject: Introduce LLEventDispatcher::begin()/end() to iterate over (name, desc) pairs for all registered operations. (untested) Introduce LLEventDispatcher::getMetadata(name) query so you can discover, for a given named operation, its query string and required parameters. (untested) Introduce LLEventDispatcher::add() convenience methods allowing you to omit description strings. Fix LLLoginInstance (which uses a non-LLEventAPI LLEventDispatcher) back to description-less add() calls. However, filter LLEventDispatcher::add() methods inherited by LLEventAPI so that an LLEventAPI subclass *must* provide a description string. --- indra/llcommon/lleventdispatcher.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/llcommon/lleventdispatcher.cpp') diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp index 017bf3a521..5fa6059718 100644 --- a/indra/llcommon/lleventdispatcher.cpp +++ b/indra/llcommon/lleventdispatcher.cpp @@ -121,6 +121,20 @@ LLEventDispatcher::Callable LLEventDispatcher::get(const std::string& name) cons return found->second.mFunc; } +LLSD LLEventDispatcher::getMetadata(const std::string& name) const +{ + DispatchMap::const_iterator found = mDispatch.find(name); + if (found == mDispatch.end()) + { + return LLSD(); + } + LLSD meta; + meta["name"] = name; + meta["desc"] = found->second.mDesc; + meta["required"] = found->second.mRequired; + return meta; +} + LLDispatchListener::LLDispatchListener(const std::string& pumpname, const std::string& key): LLEventDispatcher(pumpname, key), mPump(pumpname, true), // allow tweaking for uniqueness -- cgit v1.2.3