diff options
author | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
commit | 5e9e67cb2d1d3dfc82dfe96103270b2341991ddd (patch) | |
tree | 2df2a064523b2bffef6ff7566399c76b1f2cc196 /indra/llmessage | |
parent | 1ada34fc0c5dc20bffba231ef513b569dbec32ea (diff) |
merge -r 59028:59178 maintenance -> release.
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llcachename.cpp | 34 | ||||
-rw-r--r-- | indra/llmessage/llcachename.h | 2 |
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); |