MySQL 9.3.0
Source Code Documentation
mrs::EndpointResponseCache Class Reference

#include <response_cache.h>

Inheritance diagram for mrs::EndpointResponseCache:
[legend]

Public Types

using Uri = ::http::base::Uri
 
using UniversalId = ::mrs::database::entry::UniversalId
 

Protected Member Functions

 EndpointResponseCache (ResponseCache *owner, uint64_t ttl_ms)
 
virtual ~EndpointResponseCache ()=default
 
std::shared_ptr< CacheEntrycreate_entry (const std::string &key, const std::string &data, int64_t items=0, std::optional< helper::MediaType > media_type={}, std::optional< std::string > media_type_str={})
 
void remove_entry (std::shared_ptr< CacheEntry > entry, bool ejected)
 
virtual void remove_entry_nolock (std::shared_ptr< CacheEntry > entry, bool ejected)
 
std::shared_ptr< CacheEntrylookup (const std::string &key)
 

Protected Attributes

ResponseCacheowner_
 
std::chrono::milliseconds ttl_
 
std::unordered_map< std::string, std::shared_ptr< CacheEntry > > cache_
 
std::shared_mutex cache_mutex_
 

Friends

class ResponseCache
 

Member Typedef Documentation

◆ UniversalId

◆ Uri

Constructor & Destructor Documentation

◆ EndpointResponseCache()

mrs::EndpointResponseCache::EndpointResponseCache ( ResponseCache owner,
uint64_t  ttl_ms 
)
protected

◆ ~EndpointResponseCache()

virtual mrs::EndpointResponseCache::~EndpointResponseCache ( )
protectedvirtualdefault

Member Function Documentation

◆ create_entry()

std::shared_ptr< CacheEntry > mrs::EndpointResponseCache::create_entry ( const std::string &  key,
const std::string &  data,
int64_t  items = 0,
std::optional< helper::MediaType media_type = {},
std::optional< std::string >  media_type_str = {} 
)
protected

◆ lookup()

std::shared_ptr< CacheEntry > mrs::EndpointResponseCache::lookup ( const std::string &  key)
protected

◆ remove_entry()

void mrs::EndpointResponseCache::remove_entry ( std::shared_ptr< CacheEntry entry,
bool  ejected 
)
protected

◆ remove_entry_nolock()

void mrs::EndpointResponseCache::remove_entry_nolock ( std::shared_ptr< CacheEntry entry,
bool  ejected 
)
protectedvirtual

Friends And Related Function Documentation

◆ ResponseCache

friend class ResponseCache
friend

Member Data Documentation

◆ cache_

std::unordered_map<std::string, std::shared_ptr<CacheEntry> > mrs::EndpointResponseCache::cache_
protected

◆ cache_mutex_

std::shared_mutex mrs::EndpointResponseCache::cache_mutex_
protected

◆ owner_

ResponseCache* mrs::EndpointResponseCache::owner_
protected

◆ ttl_

std::chrono::milliseconds mrs::EndpointResponseCache::ttl_
protected

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