Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ICacheLoader Struct Reference

Inheritance diagram for ICacheLoader:

IRemoteCacheLoader NetworkCache::RemoteLoader List of all members.

Public Member Functions

bool test (IPayload p)
IPayload load (char[] key, long time)

Detailed Description

Manages the lifespan of an ICache entry. These loaders effectively isolate the cache from whence the content is derived. It's a good idea to employ this abstraction where appropriate, since it allows the cache source to change with minimal (if any) impact on client code.

Definition at line 114 of file ICache.d.


Member Function Documentation

bool test IPayload  p  ) 
 

Test the cache entry to see if it is still valid. A true return value indicates the entry is valid, whereas false flags the entry as stale. The latter case will cause the load() method to be invoked.

Reimplemented in NetworkCache::RemoteLoader.

Referenced by PlainCache::bind(), testCacheLoader(), and testRemoteCacheLoader().

IPayload load char[]  key,
long  time
 

Load a cache entry from wherever the content is persisted. The 'time' argument represents that belonging to a stale entry, which can be used to optimize the loader operation (no need to perform a full load where there's already a newer version in an L2 cache). This 'time' value will be long.min where was no such stale entry.

Reimplemented in NetworkCache::RemoteLoader.

Referenced by PlainCache::bind(), CacheServer::LoaderThread::load(), testCacheLoader(), and testRemoteCacheLoader().


The documentation for this struct was generated from the following file:
Generated on Sun Nov 7 19:07:05 2004 for Mango by doxygen 1.3.6