#include <OOCache.h>
Definition at line 57 of file OOCache.h.
◆ autoPrune
◆ dealloc
Definition at line 917 of file OOCache.m.
171{
174
175 [super dealloc];
176}
static void CacheFree(OOCacheImpl *cache)
#define CHECK_INTEGRITY(context)
struct OOCacheImpl * cache
◆ description
- (NSString *) description |
|
|
|
|
implementation |
Definition at line 917 of file OOCache.m.
180{
181 return [NSString stringWithFormat:@"<%@ %p>{\"%@\", %u elements, prune threshold=%u, auto-prune=%s dirty=%s}", [self class], self, [self name], CacheGetCount(cache), pruneThreshold, autoPrune ? "yes" : "no", dirty ? "yes" : "no"];
182}
◆ dirty
◆ init
Definition at line 917 of file OOCache.m.
186{
187 return [self initWithPList:nil];
188}
◆ initWithPList:
- (id) initWithPList: |
|
(id) | pList |
|
Definition at line 917 of file OOCache.m.
191 :(id)pList
192{
193 BOOL OK = YES;
194
195 self = [super init];
197
198 if (OK)
199 {
201 if (
cache == NULL) OK = NO;
202 }
203
205 {
206 if (OK) OK = [pList isKindOfClass:[NSArray class]];
207 if (OK) [self loadFromArray:pList];
208 }
209 if (OK)
210 {
213 }
214
215 if (!OK)
216 {
217 [self release];
219 }
220
221 return self;
222}
@ kOOCacheDefaultPruneThreshold
static OOCacheImpl * CacheAllocate(void)
◆ loadFromArray:
- (void) loadFromArray: |
|
(NSArray *) | inArray |
|
|
implementation |
Provided by category OOCache(Private).
Definition at line 917 of file OOCache.m.
364 :(NSArray *)array
365{
366 NSEnumerator *entryEnum =
nil;
367 NSDictionary *entry =
nil;
370
371 if (array ==
nil)
return;
372
373 for (entryEnum = [array objectEnumerator]; (entry = [entryEnum nextObject]); )
374 {
375 if ([entry isKindOfClass:[NSDictionary class]])
376 {
377 key = [entry objectForKey:kSerializedEntryKeyKey];
378 value = [entry objectForKey:kSerializedEntryKeyValue];
379 if ([key isKindOfClass:[NSString
class]] && value !=
nil)
380 {
381 [self setObject:value forKey:key];
382 }
383 }
384 }
385}
◆ markClean
◆ name
Definition at line 917 of file OOCache.m.
343{
345}
static NSString * CacheGetName(OOCacheImpl *cache)
◆ objectForKey:
- (id) objectForKey: |
|
(id) | key |
|
Definition at line 917 of file OOCache.m.
233 :(id)key
234{
236
238
240
241
243
244 return [[result retain] autorelease];
245}
static id CacheRetrieve(OOCacheImpl *cache, id key)
◆ objectsByAge
- (NSArray *) objectsByAge |
|
|
|
Definition at line 917 of file OOCache.m.
355{
357}
static NSArray * CacheArrayOfContentsByAge(OOCacheImpl *cache)
◆ pListRepresentation
- (id) pListRepresentation |
|
|
|
Definition at line 917 of file OOCache.m.
226{
228
230}
static NSArray * CacheArrayOfNodesByAge(OOCacheImpl *cache)
◆ prune
Definition at line 917 of file OOCache.m.
307{
308 unsigned pruneCount;
309 unsigned desiredCount;
311
312
315
317
318 pruneCount =
count - desiredCount;
319
320 NSString *logKey = [NSString stringWithFormat:@"dataCache.prune.%@", CacheGetName(cache)];
323
325
327}
static unsigned CacheGetCount(OOCacheImpl *cache)
static BOOL CacheRemoveOldest(OOCacheImpl *cache, NSString *logKey)
#define OOLogOutdentIf(class)
#define OOLog(class, format,...)
#define OOLogIndentIf(class)
◆ pruneThreshold
- (unsigned) pruneThreshold |
|
|
|
◆ removeObjectForKey:
- (void) removeObjectForKey: |
|
(id) | key |
|
Definition at line 917 of file OOCache.m.
262 :(id)key
263{
265
267
269}
static BOOL CacheRemove(OOCacheImpl *cache, id key)
◆ setAutoPrune:
- (void) setAutoPrune: |
|
(BOOL) | flag |
|
Definition at line 917 of file OOCache.m.
289 :(BOOL)flag
290{
291 BOOL
prune = (flag != NO);
293 {
295 [self prune];
296 }
297}
◆ setName:
- (void) setName: |
|
(NSString *) | name |
|
Definition at line 917 of file OOCache.m.
349{
351}
static void CacheSetName(OOCacheImpl *cache, NSString *name)
◆ setObject:forKey:
- (void) setObject: |
|
(id) | value |
forKey: |
|
(id) | key |
Definition at line 917 of file OOCache.m.
248 :inObject forKey:(id)key
249{
251
253 {
256 }
257
259}
static BOOL CacheInsert(OOCacheImpl *cache, id key, id value)
◆ setPruneThreshold:
- (void) setPruneThreshold: |
|
(unsigned) | threshold |
|
Definition at line 917 of file OOCache.m.
272 :(unsigned)threshold
273{
276 {
279 }
280}
@ kOOCacheMinimumPruneThreshold
◆ autoPrune
◆ cache
◆ dirty
◆ pruneThreshold
- (unsigned) pruneThreshold |
|
private |
The documentation for this class was generated from the following files: