net_instaweb::WriteThroughCache Class Reference

Composes two caches to form a write-through cache. More...

#include "write_through_cache.h"

Inheritance diagram for net_instaweb::WriteThroughCache:
net_instaweb::CacheInterface

List of all members.

Public Member Functions

 WriteThroughCache (CacheInterface *cache1, CacheInterface *cache2)
 Does not take ownership of caches passed in.
virtual void Get (const GoogleString &key, Callback *callback)
virtual void Put (const GoogleString &key, SharedString *value)
virtual void Delete (const GoogleString &key)
void set_cache1_limit (size_t limit)
CacheInterfacecache1 ()
CacheInterfacecache2 ()
virtual const char * Name () const
 The name of this CacheInterface -- used for logging and debugging.

Static Public Attributes

static const size_t kUnlimited

Friends

class WriteThroughCallback

Detailed Description

Composes two caches to form a write-through cache.


Member Function Documentation

virtual void net_instaweb::WriteThroughCache::Get ( const GoogleString key,
Callback callback 
) [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.

Implements net_instaweb::CacheInterface.

virtual void net_instaweb::WriteThroughCache::Put ( const GoogleString key,
SharedString value 
) [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.

Implements net_instaweb::CacheInterface.

void net_instaweb::WriteThroughCache::set_cache1_limit ( size_t  limit  )  [inline]

By default, all data goes into both cache1 and cache2. But if you only want to put small items in cache1, you can set the size limit. Note that both the key and value will count torward the size.


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:22 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3