KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DATABASE_CACHE< CacheValueType > Class Template Reference

#include <database_cache.h>

Public Types

typedef std::pair< std::string, std::pair< time_t, CacheValueType > > CACHE_ENTRY
 
typedef std::unordered_map< std::string, typename std::list< CACHE_ENTRY >::iterator > CACHE_TYPE
 
typedef CACHE_TYPE::const_iterator CACHE_CITER
 
typedef CacheValueType CACHE_VALUE
 

Public Member Functions

 DATABASE_CACHE (size_t aMaxSize, time_t aMaxAge)
 
void Put (const std::string &aQuery, const CacheValueType &aResult)
 
bool Get (const std::string &aQuery, CacheValueType &aResult)
 
void SetMaxSize (size_t aMaxSize)
 
void SetMaxAge (time_t aMaxAge)
 

Private Attributes

size_t m_maxSize
 
time_t m_maxAge
 
std::list< CACHE_ENTRYm_cacheMru
 
CACHE_TYPE m_cache
 

Detailed Description

template<typename CacheValueType>
class DATABASE_CACHE< CacheValueType >

Definition at line 33 of file database_cache.h.

Member Typedef Documentation

◆ CACHE_CITER

template<typename CacheValueType >
typedef CACHE_TYPE::const_iterator DATABASE_CACHE< CacheValueType >::CACHE_CITER

Definition at line 40 of file database_cache.h.

◆ CACHE_ENTRY

template<typename CacheValueType >
typedef std::pair<std::string, std::pair<time_t, CacheValueType> > DATABASE_CACHE< CacheValueType >::CACHE_ENTRY

Definition at line 36 of file database_cache.h.

◆ CACHE_TYPE

template<typename CacheValueType >
typedef std::unordered_map<std::string, typename std::list<CACHE_ENTRY>::iterator> DATABASE_CACHE< CacheValueType >::CACHE_TYPE

Definition at line 38 of file database_cache.h.

◆ CACHE_VALUE

template<typename CacheValueType >
typedef CacheValueType DATABASE_CACHE< CacheValueType >::CACHE_VALUE

Definition at line 42 of file database_cache.h.

Constructor & Destructor Documentation

◆ DATABASE_CACHE()

template<typename CacheValueType >
DATABASE_CACHE< CacheValueType >::DATABASE_CACHE ( size_t  aMaxSize,
time_t  aMaxAge 
)
inline

Definition at line 44 of file database_cache.h.

Member Function Documentation

◆ Get()

template<typename CacheValueType >
bool DATABASE_CACHE< CacheValueType >::Get ( const std::string &  aQuery,
CacheValueType &  aResult 
)
inline

◆ Put()

template<typename CacheValueType >
void DATABASE_CACHE< CacheValueType >::Put ( const std::string &  aQuery,
const CacheValueType &  aResult 
)
inline

◆ SetMaxAge()

template<typename CacheValueType >
void DATABASE_CACHE< CacheValueType >::SetMaxAge ( time_t  aMaxAge)
inline

Definition at line 98 of file database_cache.h.

References DATABASE_CACHE< CacheValueType >::m_maxAge.

◆ SetMaxSize()

template<typename CacheValueType >
void DATABASE_CACHE< CacheValueType >::SetMaxSize ( size_t  aMaxSize)
inline

Definition at line 97 of file database_cache.h.

References DATABASE_CACHE< CacheValueType >::m_maxSize.

Member Data Documentation

◆ m_cache

template<typename CacheValueType >
CACHE_TYPE DATABASE_CACHE< CacheValueType >::m_cache
private

◆ m_cacheMru

template<typename CacheValueType >
std::list<CACHE_ENTRY> DATABASE_CACHE< CacheValueType >::m_cacheMru
private

◆ m_maxAge

template<typename CacheValueType >
time_t DATABASE_CACHE< CacheValueType >::m_maxAge
private

◆ m_maxSize

template<typename CacheValueType >
size_t DATABASE_CACHE< CacheValueType >::m_maxSize
private

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