#include <CacheEngine.hpp>
Inheritance diagram for Cache::RequiredFetcherImplementation:
Every time the cache miss a document, it will call one of the method from this interface. Implementation is left to the browser part. Every method should be re-entrant (for thread safety). It's implementation role to ensure thread safeness in case it uses threads.
In case of fetching error, the fetcher must set the item status to corresponding error.
An application must implement this callback in order to use the holder
Public Member Functions | |
virtual uint32 | isItemFetched (volatile Item &item) const =0 |
Check if all data for a previously queued item has been received. | |
virtual bool | queueDocumentToFetch (volatile Item &item, void *opaque=0)=0 |
Add a document to fetch, as soon as possible, to the query list. |
virtual uint32 Cache::RequiredFetcherImplementation::isItemFetched | ( | volatile Item & | item | ) | const [pure virtual] |
Check if all data for a previously queued item has been received.
The holder will call this method to check if an item is fully available, or is being fetched. It's the fetcher role to return the state of the fetching.
item | A reference on an item to check reception |
virtual bool Cache::RequiredFetcherImplementation::queueDocumentToFetch | ( | volatile Item & | item, | |
void * | opaque = 0 | |||
) | [pure virtual] |
Add a document to fetch, as soon as possible, to the query list.
The holder will call this method when the cache item is missed (either item's lifetime expired, or on not found event). It's possible to queue the fetching on a thread pool. The cache will then wait until a signal is sent to it, and returns the fetched item's data on success.
item | A reference on an item to fetch as soon as possible | |
opaque | An opaque object that could be used to pass any structure from the cache to the fetcher |