summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventdispatcher.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-11 10:44:39 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-11 10:44:39 -0500
commit652c8f6b5e91e1333854ac5e300b0bf650d03fc2 (patch)
tree4c0375dddbf315baa73c30fe648eb0915f3e3f2a /indra/llcommon/lleventdispatcher.cpp
parentaf9b99b457a6a6ab9f04a20bcde6a90091321375 (diff)
parent062d0a13db505636b186084d42c527a49637f380 (diff)
merge
Diffstat (limited to 'indra/llcommon/lleventdispatcher.cpp')
-rw-r--r--indra/llcommon/lleventdispatcher.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp
index 6b1413d054..017bf3a521 100644
--- a/indra/llcommon/lleventdispatcher.cpp
+++ b/indra/llcommon/lleventdispatcher.cpp
@@ -36,9 +36,11 @@ LLEventDispatcher::~LLEventDispatcher()
}
/// Register a callable by name
-void LLEventDispatcher::add(const std::string& name, const Callable& callable, const LLSD& required)
+void LLEventDispatcher::add(const std::string& name, const std::string& desc,
+ const Callable& callable, const LLSD& required)
{
- mDispatch[name] = DispatchMap::mapped_type(callable, required);
+ mDispatch.insert(DispatchMap::value_type(name,
+ DispatchMap::mapped_type(callable, desc, required)));
}
void LLEventDispatcher::addFail(const std::string& name, const std::string& classname) const
@@ -98,14 +100,14 @@ bool LLEventDispatcher::attemptCall(const std::string& name, const LLSD& event)
}
// Found the name, so it's plausible to even attempt the call. But first,
// validate the syntax of the event itself.
- std::string mismatch(llsd_matches(found->second.second, event));
+ std::string mismatch(llsd_matches(found->second.mRequired, event));
if (! mismatch.empty())
{
LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << ") calling '" << name
<< "': bad request: " << mismatch << LL_ENDL;
}
// Event syntax looks good, go for it!
- (found->second.first)(event);
+ (found->second.mFunc)(event);
return true; // tell caller we were able to call
}
@@ -116,7 +118,7 @@ LLEventDispatcher::Callable LLEventDispatcher::get(const std::string& name) cons
{
return Callable();
}
- return found->second.first;
+ return found->second.mFunc;
}
LLDispatchListener::LLDispatchListener(const std::string& pumpname, const std::string& key):