net_instaweb::CacheInterface Class Reference

Abstract interface for a cache. More...

#include "cache_interface.h"

Inheritance diagram for net_instaweb::CacheInterface:
net_instaweb::DelayCache net_instaweb::FileCache net_instaweb::LRUCache net_instaweb::MockTimeCache net_instaweb::ThreadsafeCache net_instaweb::WriteThroughCache

List of all members.

Classes

class  Callback

Public Types

enum  KeyState { kAvailable, kNotFound }

Public Member Functions

virtual void Get (const GoogleString &key, Callback *callback)=0
virtual void Put (const GoogleString &key, SharedString *value)=0
virtual void Delete (const GoogleString &key)=0
virtual const char * Name () const =0
 The name of this CacheInterface -- used for logging and debugging.

Protected Member Functions

void ValidateAndReportResult (const GoogleString &key, KeyState state, Callback *callback)
 Invokes callback->ValidateCandidate() and callback->Done() as appropriate.

Detailed Description

Abstract interface for a cache.


Member Enumeration Documentation

Enumerator:
kAvailable 

Requested key is available for serving.

kNotFound 

Requested key needs to be written.


Member Function Documentation

virtual void net_instaweb::CacheInterface::Get ( const GoogleString key,
Callback callback 
) [pure virtual]

Initiates a cache fetch, calling callback->ValidateCandidate() and then callback->Done(state) when done.

Note: implementations should normally invoke the callback via ValidateAndReportResult, which will combine ValidateCandidate() and Done() together properly.

Implemented in net_instaweb::DelayCache, net_instaweb::FileCache, net_instaweb::LRUCache, net_instaweb::MockTimeCache, net_instaweb::ThreadsafeCache, and net_instaweb::WriteThroughCache.

virtual void net_instaweb::CacheInterface::Put ( const GoogleString key,
SharedString value 
) [pure virtual]

Puts a value into the cache. The value that is passed in is not modified, but the SharedString is passed by non-const pointer because its reference count is bumped.

Implemented in net_instaweb::DelayCache, net_instaweb::FileCache, net_instaweb::LRUCache, net_instaweb::MockTimeCache, net_instaweb::ThreadsafeCache, and net_instaweb::WriteThroughCache.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:08 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3