summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcachename.cpp34
-rw-r--r--indra/llmessage/llcachename.h2
2 files changed, 36 insertions, 0 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 6841dda9a4..339fdda9ef 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -257,6 +257,40 @@ void LLCacheName::addObserver(LLCacheNameCallback callback)
impl.mObservers.push_back(callback);
}
+void LLCacheName::removeObserver(LLCacheNameCallback callback)
+{
+ Observers::iterator it = impl.mObservers.begin();
+ Observers::iterator end = impl.mObservers.end();
+
+ for ( ; it != end; ++it)
+ {
+ const LLCacheNameCallback& cb = (*it);
+ if (cb == callback)
+ {
+ impl.mObservers.erase(it);
+ return;
+ }
+ }
+}
+
+void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data)
+{
+ ReplyQueue::iterator it = impl.mReplyQueue.begin();
+ ReplyQueue::iterator end = impl.mReplyQueue.end();
+
+ for(; it != end; ++it)
+ {
+ const PendingReply& reply = (*it);
+
+ if ((callback == reply.mCallback)
+ && (id == reply.mID)
+ && (user_data == reply.mData) )
+ {
+ impl.mReplyQueue.erase(it);
+ return;
+ }
+ }
+}
void LLCacheName::importFile(FILE* fp)
{
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index ec9c467d8b..af49903c88 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -41,6 +41,8 @@ public:
void addObserver(LLCacheNameCallback callback);
void removeObserver(LLCacheNameCallback callback);
+ void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL);
+
// storing cache on disk; for viewer, in name.cache
void importFile(FILE* fp);
void exportFile(FILE* fp);