Page Speed Optimization Libraries  1.3.25.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Protected Member Functions | Friends
net_instaweb::PropertyPage Class Reference

#include "property_cache.h"

Inheritance diagram for net_instaweb::PropertyPage:
net_instaweb::MockPropertyPage net_instaweb::PropertyCallback net_instaweb::ProxyFetchPropertyCallback

List of all members.

Classes

struct  PropertyMapStruct

Public Member Functions

PropertyValueGetProperty (const PropertyCache::Cohort *cohort, const StringPiece &property_name)
void DeleteProperty (const PropertyCache::Cohort *cohort, const StringPiece &property_name)
const GoogleStringkey () const
LogRecordlog_record ()
virtual void LogPageCohortInfo (LogRecord *log_record, int cohort_index)
 Adds logs for the given PropertyPage to the specified cohort info index.

Protected Member Functions

 PropertyPage (AbstractMutex *mutex, const PropertyCache &property_cache, const StringPiece &key, const RequestContextPtr &request_context)
 The Page takes ownership of the mutex.
virtual bool IsCacheValid (int64 write_timestamp_ms) const
virtual void Done (bool success)=0
 Called as a result of PropertyCache::Read when the data is available.

Friends

class CallbackCollector
class PropertyCache::CacheInterfaceCallback
class PropertyCache

Detailed Description

Holds the property values associated with a single key. See more extensive comment for PropertyPage above.


Member Function Documentation

void net_instaweb::PropertyPage::DeleteProperty ( const PropertyCache::Cohort cohort,
const StringPiece &  property_name 
)

Deletes a property given the property name.

This function deletes the PropertyValue if it already exists, otherwise it is a no-op function.

It is a programming error to call DeleteProperty on a PropertyPage that has not yet been read.

This function actually does not commit it to cache.

PropertyValue* net_instaweb::PropertyPage::GetProperty ( const PropertyCache::Cohort cohort,
const StringPiece &  property_name 
)

Gets a property given the property name. The property can then be mutated, prior to the PropertyPage being written back to the cache.

The returned PropertyValue object is owned by the PropertyPage and should not be deleted by the caller.

This function creates the PropertyValue if it didn't already exist, either from a previous call or a cache-read.

It is a programming error to call GetProperty on a PropertyPage that has not yet been read.

Note that all the properties in all the Cohorts on a Page are read via PropertyCache::Read. This allows cache implementations that support batching to do so on the read. However, properties are written back to cache one Cohort at a time, via PropertyCache::WriteCohort.

virtual bool net_instaweb::PropertyPage::IsCacheValid ( int64  write_timestamp_ms) const [inline, protected, virtual]

Called immediatly after the underlying cache lookup is done, from PropertyCache::CacheInterfaceCallback::Done().

Reimplemented in net_instaweb::ProxyFetchPropertyCallback, and net_instaweb::MockPropertyPage.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines