aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Cache.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-13 14:34:33 +0000
committerMelanie Thielker2008-08-13 14:34:33 +0000
commitdd1fc5e3fe702d87c189732f4c24df7dbc5cd928 (patch)
treed457c9fc118fe9804534bbe0c8f29bfd044a9acd /OpenSim/Framework/Cache.cs
parentMantis#1934. Thank you Tyre for a patch that: (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Framework/Cache.cs11
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 {