diff options
author | Oz Linden <oz@lindenlab.com> | 2016-04-04 15:53:09 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-04-04 15:53:09 -0400 |
commit | 9be58e915a6c69de280ccabd3019e9ac40beed26 (patch) | |
tree | ad6f8f1f754a865afb761d0f17744cc7e1ef8b74 /indra/llcommon/llevents.cpp | |
parent | ab46c9226bd9048fa218f54bc8668594401529e7 (diff) | |
parent | 18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff) |
merge with 4.0.3-release
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rw-r--r-- | indra/llcommon/llevents.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 1c928b3db8..645c29d770 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -132,6 +132,17 @@ LLEventPump& LLEventPumps::obtain(const std::string& name) return *newInstance; } +bool LLEventPumps::post(const std::string&name, const LLSD&message) +{ + PumpMap::iterator found = mPumpMap.find(name); + + if (found == mPumpMap.end()) + return false; + + return (*found).second->post(message); +} + + void LLEventPumps::flush() { // Flush every known LLEventPump instance. Leave it up to each instance to @@ -497,6 +508,43 @@ bool LLEventStream::post(const LLSD& event) } /***************************************************************************** + * LLEventMailDrop + *****************************************************************************/ +bool LLEventMailDrop::post(const LLSD& event) +{ + bool posted = false; + + if (!mSignal->empty()) + posted = LLEventStream::post(event); + + if (!posted) + { // if the event was not handled we will save it for later so that it can + // be posted to any future listeners when they attach. + mEventHistory.push_back(event); + } + + return posted; +} + +LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, + const LLEventListener& listener, + const NameList& after, + const NameList& before) +{ + if (!mEventHistory.empty()) + { + if (listener(mEventHistory.front())) + { + mEventHistory.pop_front(); + } + } + + return LLEventStream::listen_impl(name, listener, after, before); + +} + + +/***************************************************************************** * LLEventQueue *****************************************************************************/ bool LLEventQueue::post(const LLSD& event) |