summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llnotifications.h')
-rw-r--r--indra/llui/llnotifications.h38
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;
};