19 #ifndef PAGESPEED_KERNEL_CACHE_WRITE_THROUGH_CACHE_H_
20 #define PAGESPEED_KERNEL_CACHE_WRITE_THROUGH_CACHE_H_
28 #include "pagespeed/kernel/cache/cache_interface.h"
30 namespace net_instaweb {
35 static const size_t kUnlimited;
41 cache1_size_limit_(kUnlimited) {
55 size_t cache1_limit()
const {
return cache1_size_limit_; }
57 CacheInterface* cache1() {
return cache1_; }
58 CacheInterface* cache2() {
return cache2_; }
74 return FormatName(cache1_->
Name(), cache2_->
Name());
76 static GoogleString FormatName(StringPiece l1, StringPiece l2);
80 friend class WriteThroughCallback;
84 size_t cache1_size_limit_;
WriteThroughCache(CacheInterface *cache1, CacheInterface *cache2)
Does not take ownership of caches passed in.
Definition: write_through_cache.h:38
Abstract interface for a cache.
Definition: cache_interface.h:32
virtual bool IsHealthy() const
Definition: write_through_cache.h:64
virtual void ShutDown()
Definition: write_through_cache.h:68
void set_cache1_limit(size_t limit)
Definition: write_through_cache.h:54
virtual void Get(const GoogleString &key, Callback *callback)
virtual void Put(const GoogleString &key, const SharedString &value)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual GoogleString Name() const
Definition: write_through_cache.h:73
virtual bool IsHealthy() const =0
virtual bool IsBlocking() const =0
Composes two caches to form a write-through cache.
Definition: write_through_cache.h:33
Definition: shared_string.h:40
virtual void ShutDown()=0
virtual GoogleString Name() const =0
virtual bool IsBlocking() const
Definition: write_through_cache.h:59