From dd1fc5e3fe702d87c189732f4c24df7dbc5cd928 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 13 Aug 2008 14:34:33 +0000 Subject: Add a Find(Predicate) method to the cache to look for items by data other than LLUUID. --- OpenSim/Framework/Cache.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Framework') 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 return data; } + // Find an object in cache by delegate. + // + public Object Find(Predicate d) + { + CacheItemBase item = m_Index.Find(d); + + if(item == null) + return null; + + return item.Retrieve(); + } public virtual void Store(LLUUID index, Object data) { -- cgit v1.1