Rose
Public Member Functions | Protected Attributes | List of all members
rose::CacheWebSource Class Reference

A cache source on the World Wide Web. More...

#include <Cache.h>

Inheritance diagram for rose::CacheWebSource:
Inheritance graph
[legend]
Collaboration diagram for rose::CacheWebSource:
Collaboration graph
[legend]

Public Member Functions

 CacheWebSource (std::string sourceURI)
 Constructor. More...
 
 CacheWebSource (std::string sourceURI, std::chrono::system_clock::duration cacheValidityDuration)
 Constructor. More...
 
void fetch (CacheObject &cacheObject, std::ostream &ostrm, time_t cacheTime) override
 Fetch a source object. More...
 
long responseCode () const
 Get the response code returned by the server. More...
 
const std::string & sourceURI () const
 
- Public Member Functions inherited from rose::CacheSource
auto cacheValidDuration () const
 Access the cache object validity period. More...
 

Protected Attributes

std::string mSourceURI
 The URI for the source.
 
long mResponseCode {0}
 The returned response code.
 
- Protected Attributes inherited from rose::CacheSource
std::chrono::system_clock::duration mCacheValidDuration {}
 

Detailed Description

A cache source on the World Wide Web.

Constructor & Destructor Documentation

◆ CacheWebSource() [1/2]

rose::CacheWebSource::CacheWebSource ( std::string  sourceURI)
explicit

Constructor.

The sourceURI will be prepended to the CacheObject source name to create the CacheObject source URI. The default cache validity period is 1 hour on the system clock.

Parameters
sourceURIThe source URI.

◆ CacheWebSource() [2/2]

rose::CacheWebSource::CacheWebSource ( std::string  sourceURI,
std::chrono::system_clock::duration  cacheValidityDuration 
)

Constructor.

The sourceURI will be prepended to the CacheObject source name to create the CacheObject source URI. The cache validity period is set to the value specified in cacheValidityDuration.

Parameters
sourceURIThe source URI.
cacheValidityDurationThe duration that a cache object is considered valid.

Member Function Documentation

◆ fetch()

void rose::CacheWebSource::fetch ( CacheObject cacheObject,
std::ostream &  ostrm,
time_t  cacheTime 
)
overridevirtual

Fetch a source object.

Parameters
cacheObjectThe object to fetch.
ostrmAn output stream to write the object to.
cacheTimeThe time for the object currently in cache.

Implements rose::CacheSource.

◆ responseCode()

long rose::CacheWebSource::responseCode ( ) const
inline

Get the response code returned by the server.

Returns
the response code.

The documentation for this class was generated from the following files: