diff options
author | Brad Linden <brad@lindenlab.com> | 2024-04-24 09:55:34 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-04-24 09:55:34 -0700 |
commit | 86c0c1d5536897c925f4e8aa2859a160313d964c (patch) | |
tree | 9d32be1b0d6a4dd139d8a72b35a94f48046b2ffc /indra/llui/llnotifications.h | |
parent | cadc1a02cc7289dabd368dd1a1d237c042e9f82e (diff) | |
parent | d98fc504a1d4bc292ba86acdda053c8b4598a193 (diff) |
Merge remote-tracking branch 'origin/main' into release/materials_featurette
Diffstat (limited to 'indra/llui/llnotifications.h')
-rw-r--r-- | indra/llui/llnotifications.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 4d9a33f1d7..8e61ff5259 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -738,16 +738,19 @@ class LLNotificationChannelBase : { LOG_CLASS(LLNotificationChannelBase); public: - LLNotificationChannelBase(LLNotificationFilter filter) - : mFilter(filter), - mItems() - {} + LLNotificationChannelBase(LLNotificationFilter filter) + : mFilter(filter) + , mItems() + , mItemsMutex() + {} + virtual ~LLNotificationChannelBase() { // explicit cleanup for easier issue detection mChanged.disconnect_all_slots(); mPassedFilter.disconnect_all_slots(); mFailedFilter.disconnect_all_slots(); + LLMutexLock lock(&mItemsMutex); mItems.clear(); } // you can also connect to a Channel, so you can be notified of @@ -786,6 +789,7 @@ protected: LLStandardSignal mChanged; LLStandardSignal mPassedFilter; LLStandardSignal mFailedFilter; + LLMutex mItemsMutex; // these are action methods that subclasses can override to take action // on specific types of changes; the management of the mItems list is @@ -835,7 +839,7 @@ public: LLNotificationChannel(const Params& p = Params()); LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter); - virtual ~LLNotificationChannel() {} + virtual ~LLNotificationChannel(); typedef LLNotificationSet::iterator Iterator; std::string getName() const { return mName; } @@ -844,21 +848,23 @@ public: { return boost::iterator_range<parents_iter>(mParents); } - - void connectToChannel(const std::string& channel_name); - + bool isEmpty() const; S32 size() const; - - Iterator begin(); - Iterator end(); - size_t size(); - + size_t size(); + + typedef boost::function<void(LLNotificationPtr)> NotificationProcess; + void forEachNotification(NotificationProcess process); + std::string summarize(); +protected: + void connectToChannel(const std::string& channel_name); + private: std::string mName; std::vector<std::string> mParents; + std::vector<LLBoundListener> mListeners; }; // An interface class to provide a clean linker seam to the LLNotifications class. @@ -924,10 +930,6 @@ public: void update(const LLNotificationPtr pNotif); LLNotificationPtr find(LLUUID uuid); - - typedef boost::function<void (LLNotificationPtr)> NotificationProcess; - - void forEachNotification(NotificationProcess process); // This is all stuff for managing the templates // take your template out @@ -990,7 +992,7 @@ private: bool mIgnoreAllNotifications; - boost::scoped_ptr<LLNotificationsListener> mListener; + std::unique_ptr<LLNotificationsListener> mListener; std::vector<LLNotificationChannelPtr> mDefaultChannels; }; |