diff options
author | Melanie Thielker | 2008-08-13 14:34:33 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-13 14:34:33 +0000 |
commit | dd1fc5e3fe702d87c189732f4c24df7dbc5cd928 (patch) | |
tree | d457c9fc118fe9804534bbe0c8f29bfd044a9acd /OpenSim/Framework/Cache.cs | |
parent | Mantis#1934. Thank you Tyre for a patch that: (diff) | |
download | opensim-SC_OLD-dd1fc5e3fe702d87c189732f4c24df7dbc5cd928.zip opensim-SC_OLD-dd1fc5e3fe702d87c189732f4c24df7dbc5cd928.tar.gz opensim-SC_OLD-dd1fc5e3fe702d87c189732f4c24df7dbc5cd928.tar.bz2 opensim-SC_OLD-dd1fc5e3fe702d87c189732f4c24df7dbc5cd928.tar.xz |
Add a Find(Predicate) method to the cache to look for items by data
other than LLUUID.
Diffstat (limited to 'OpenSim/Framework/Cache.cs')
-rw-r--r-- | OpenSim/Framework/Cache.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index 7a1d682..8d93d3e 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs | |||
@@ -354,6 +354,17 @@ namespace Opensim.Framework | |||
354 | return data; | 354 | return data; |
355 | } | 355 | } |
356 | 356 | ||
357 | // Find an object in cache by delegate. | ||
358 | // | ||
359 | public Object Find(Predicate<Opensim.Framework.CacheItemBase> d) | ||
360 | { | ||
361 | CacheItemBase item = m_Index.Find(d); | ||
362 | |||
363 | if(item == null) | ||
364 | return null; | ||
365 | |||
366 | return item.Retrieve(); | ||
367 | } | ||
357 | 368 | ||
358 | public virtual void Store(LLUUID index, Object data) | 369 | public virtual void Store(LLUUID index, Object data) |
359 | { | 370 | { |