MyObjectCache Class Reference

This class caches any kind of object. More...

#import <MyObjectCache.h>

Inheritance diagram for MyObjectCache:

Inheritance graph
[legend]
Collaboration diagram for MyObjectCache:

Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithSize:policy:
 Initializer.
(void) - setObject:forKey:
 Put an object in the cache.
(NSObject *) - getObjectForKey:
 Retrieve an object from the cache.
(void) - setSize:
 Adapt the cache to a new size.


Detailed Description

This class caches any kind of object.

Member Function Documentation

- (id) initWithSize: (unsigned int)  size
policy: (unsigned short)  policy 

Initializer.

Parameters:
size The maximum number of objects in the cache
policy The refresh policy of the cache
Returns:
The initialized cache object When first added to the cache, objects are always at the top, whatever the policy

- (void) setObject: (NSObject*)  obj
forKey: (id)  key 

Put an object in the cache.

Parameters:
obj The object to add to the cache
key The key to identify this object

- (NSObject *) getObjectForKey: (id)  key  

Retrieve an object from the cache.

Parameters:
key the key for this object
Returns:
The object it it was found in the cache, nil otherwise

- (void) setSize: (unsigned int)  size  

Adapt the cache to a new size.

Parameters:
size The new size


The documentation for this class was generated from the following files:
Generated on Sat Mar 22 17:44:52 2008 for Lynkeos by  doxygen 1.5.4