summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventdispatcher.cpp
diff options
context:
space:
mode:
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):