diff options
author | rider <rider@lindenlab.com> | 2015-12-17 09:07:50 -0800 |
---|---|---|
committer | rider <rider@lindenlab.com> | 2015-12-17 09:07:50 -0800 |
commit | db70768def60016daabaf25f38d516d6b72f77ce (patch) | |
tree | 039f0a42f940d03a0e5f365e207ac92956ac17b1 /indra/llcommon/lleventcoro.h | |
parent | 83c9c6df07ab602bdbd2487e587956d0e67993e2 (diff) | |
parent | 6a062089b86c092d6227a64502c4829fc6f0c586 (diff) |
Merge
Diffstat (limited to 'indra/llcommon/lleventcoro.h')
-rwxr-xr-x | indra/llcommon/lleventcoro.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index bcc8cdda1d..acf2ad24a4 100755 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -32,6 +32,7 @@ #include <boost/optional.hpp> #include <string> #include <stdexcept> +#include <utility> // std::pair #include "llevents.h" #include "llerror.h" @@ -75,6 +76,8 @@ private: namespace llcoro { +typedef std::pair<LLSD, bool*> LLSD_consumed; + /// This is an adapter for a signature like void LISTENER(const LLSD&), which /// isn't a valid LLEventPump listener: such listeners should return bool. template <typename LISTENER> @@ -84,11 +87,13 @@ public: VoidListener(const LISTENER& listener): mListener(listener) {} + bool operator()(const LLSD& event) { - mListener(event); - // don't swallow the event, let other listeners see it - return false; + bool consumed = false; + mListener(LLSD_consumed(event, &consumed)); + // tell upstream LLEventPump whether listener consumed + return consumed; } private: LISTENER mListener; |