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

The base class for an object to be cached. More...

#include <Cache.h>

Public Member Functions

 CacheObject (std::string srcName, std::string userName="")
 Constructor. More...
 
const std::string & objectSrcName () const
 Accessor for the object source name. More...
 
const std::string & objectUsrName () const
 Accessor for the object user name. More...
 
void setStatusCode (long statusCode)
 Set the cash fetch status code. More...
 
long getStatusCode () const
 Get the cache fetch status code. More...
 
void setFirstProcess ()
 Called after the first process. More...
 
bool getFirstProcess () const
 Get the value of the first process flag. More...
 

Protected Attributes

std::string mObjectSrcName {}
 The name of the resource at the source.
 
std::string mObjectUsrName {}
 The name to presetn to the user.
 
long mStatusCode
 The status code for the last fetch.
 
bool mFirstProcess {false}
 Used to mange handling on first "fetch".
 

Detailed Description

The base class for an object to be cached.

Constructor & Destructor Documentation

◆ CacheObject()

rose::CacheObject::CacheObject ( std::string  srcName,
std::string  userName = "" 
)
inlineexplicit

Constructor.

Parameters
srcNameThe name of the object on the source.
userNameThe name of the object to present to the user.

Member Function Documentation

◆ getFirstProcess()

bool rose::CacheObject::getFirstProcess ( ) const
inline

Get the value of the first process flag.

Returns
the value of mFirstProcess.

◆ getStatusCode()

long rose::CacheObject::getStatusCode ( ) const
inline

Get the cache fetch status code.

Returns
The status code set by the cache source.

◆ objectSrcName()

const std::string& rose::CacheObject::objectSrcName ( ) const
inline

Accessor for the object source name.

Returns
The object source name.

◆ objectUsrName()

const std::string& rose::CacheObject::objectUsrName ( ) const
inline

Accessor for the object user name.

Returns
The object user name.

◆ setFirstProcess()

void rose::CacheObject::setFirstProcess ( )
inline

Called after the first process.

When true the object has been initially processed from the cache either after a fetch, or directly from an existing cache entry. If the value mFirstProcess is false during a fetch, status codes of 304 are treated as if they were 200.

◆ setStatusCode()

void rose::CacheObject::setStatusCode ( long  statusCode)
inline

Set the cash fetch status code.

Parameters
statusCodeThe status code set by the cache source.

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