From 2763bbd97519d35a43aedf279751e7b1045581dc Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 4 Dec 2015 14:27:22 -0800 Subject: Initial changes for Vivox/Azumarill merge. Lots of temporary code and conditional compile switches. Begin switch from statemachine to coroutine. --- indra/llcommon/llevents.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llcommon/llevents.h') diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 0cbd1da32d..8d4fa68350 100755 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -217,6 +217,18 @@ public: * an instance without conferring @em ownership. */ LLEventPump& obtain(const std::string& name); + + /** + * Find the named LLEventPump instance. If it exists post the message to it. + * If the pump does not exist, do nothing. + * + * returns the result of the LLEventPump::post. If no pump exists returns false. + * + * This is syntactically similar to LLEventPumps::instance().post(name, message), + * however if the pump does not already exist it will not be created. + */ + bool post(const std::string&, const LLSD&); + /** * Flush all known LLEventPump instances */ -- cgit v1.2.3 From 83c9c6df07ab602bdbd2487e587956d0e67993e2 Mon Sep 17 00:00:00 2001 From: rider Date: Thu, 17 Dec 2015 09:06:19 -0800 Subject: MAINT-5976: Adding MailDrop type event Queue --- indra/llcommon/llevents.h | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'indra/llcommon/llevents.h') diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 8d4fa68350..b07db889c0 100755 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -554,12 +554,13 @@ private: virtual void reset(); private: - virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, - const NameList& after, - const NameList& before); std::string mName; protected: + virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, + const NameList& after, + const NameList& before); + /// implement the dispatching boost::shared_ptr mSignal; @@ -597,11 +598,39 @@ public: virtual bool post(const LLSD& event); }; +/***************************************************************************** + * LLEventMailDrop + *****************************************************************************/ +/** + * LLEventMailDrop is a specialization of LLEventStream. Events are posted normally, + * however if no listeners return that they have handled the event it is placed in + * a list. Subsequent attaching listeners will recieve stored events until a + * listener indicates that the event has been handled. + */ +class LL_COMMON_API LLEventMailDrop: public LLEventPump +{ +public: + LLEventMailDrop(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {} + virtual ~LLEventMailDrop() {} + + /// Post an event to all listeners + virtual bool post(const LLSD& event); + +protected: + virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, + const NameList& after, + const NameList& before); + +private: + typedef std::list EventList; + EventList mEventHistory; +}; + /***************************************************************************** * LLEventQueue *****************************************************************************/ /** - * LLEventQueue isa LLEventPump whose post() method defers calling registered + * LLEventQueue is a LLEventPump whose post() method defers calling registered * listeners until flush() is called. */ class LL_COMMON_API LLEventQueue: public LLEventPump -- cgit v1.2.3 From 2c9097aa28d65eeddcfb60b9ac93495723ed6419 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 17 Dec 2015 14:09:51 -0800 Subject: MAINT-5977: Finish implementation of MailBox event pump type for guaranteed delivery --- indra/llcommon/llevents.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llevents.h') diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index b07db889c0..6175329a9d 100755 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -508,7 +508,7 @@ public: // at the boost::bind object itself before that happens. return LLEventDetail::visit_and_connect(name, listener, - boost::bind(&LLEventPump::listen_impl, + boost::bind(&LLEventPump::listen_invoke, this, name, _1, @@ -553,7 +553,16 @@ private: virtual void reset(); + + private: + LLBoundListener listen_invoke(const std::string& name, const LLEventListener& listener, + const NameList& after, + const NameList& before) + { + return this->listen_impl(name, listener, after, before); + } + std::string mName; protected: @@ -604,13 +613,14 @@ public: /** * LLEventMailDrop is a specialization of LLEventStream. Events are posted normally, * however if no listeners return that they have handled the event it is placed in - * a list. Subsequent attaching listeners will recieve stored events until a - * listener indicates that the event has been handled. + * a queue. Subsequent attaching listeners will receive stored events from the queue + * until a listener indicates that the event has been handled. In order to receive + * multiple events from a mail drop the listener must disconnect and reconnect. */ -class LL_COMMON_API LLEventMailDrop: public LLEventPump +class LL_COMMON_API LLEventMailDrop : public LLEventStream { public: - LLEventMailDrop(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {} + LLEventMailDrop(const std::string& name, bool tweak = false) : LLEventStream(name, tweak) {} virtual ~LLEventMailDrop() {} /// Post an event to all listeners -- cgit v1.2.3