Point Cloud Library (PCL)  1.14.0-dev
List of all members | Public Types | Public Member Functions | Public Attributes
LRUCache< KeyT, CacheItemT > Class Template Reference

#include <pcl/outofcore/impl/lru_cache.hpp>

Public Types

using KeyIndex = std::list< KeyT >
 
using KeyIndexIterator = typename KeyIndex::iterator
 
using Cache = std::map< KeyT, std::pair< CacheItemT, typename KeyIndex::iterator > >
 
using CacheIterator = typename Cache::iterator
 

Public Member Functions

 LRUCache (std::size_t c)
 
bool hasKey (const KeyT &k)
 
CacheItemT & get (const KeyT &k)
 
void touch (const KeyT &key)
 
bool insert (const KeyT &key, const CacheItemT &value)
 
void setCapacity (std::size_t capacity)
 
CacheItemT & tailItem ()
 
std::size_t sizeOf (const CacheItemT &value)
 
bool evict (int item_count=1)
 

Public Attributes

std::size_t capacity_
 
std::size_t size_ {0}
 
KeyIndex key_index_
 
Cache cache_
 

Detailed Description

template<typename KeyT, typename CacheItemT>
class LRUCache< KeyT, CacheItemT >

Definition at line 30 of file lru_cache.hpp.

Member Typedef Documentation

◆ Cache

template<typename KeyT , typename CacheItemT >
using LRUCache< KeyT, CacheItemT >::Cache = std::map<KeyT, std::pair<CacheItemT, typename KeyIndex::iterator> >

Definition at line 37 of file lru_cache.hpp.

◆ CacheIterator

template<typename KeyT , typename CacheItemT >
using LRUCache< KeyT, CacheItemT >::CacheIterator = typename Cache::iterator

Definition at line 38 of file lru_cache.hpp.

◆ KeyIndex

template<typename KeyT , typename CacheItemT >
using LRUCache< KeyT, CacheItemT >::KeyIndex = std::list<KeyT>

Definition at line 34 of file lru_cache.hpp.

◆ KeyIndexIterator

template<typename KeyT , typename CacheItemT >
using LRUCache< KeyT, CacheItemT >::KeyIndexIterator = typename KeyIndex::iterator

Definition at line 35 of file lru_cache.hpp.

Constructor & Destructor Documentation

◆ LRUCache()

template<typename KeyT , typename CacheItemT >
LRUCache< KeyT, CacheItemT >::LRUCache ( std::size_t  c)
inline

Definition at line 40 of file lru_cache.hpp.

References LRUCache< KeyT, CacheItemT >::capacity_.

Member Function Documentation

◆ evict()

template<typename KeyT , typename CacheItemT >
bool LRUCache< KeyT, CacheItemT >::evict ( int  item_count = 1)
inline

◆ get()

template<typename KeyT , typename CacheItemT >
CacheItemT& LRUCache< KeyT, CacheItemT >::get ( const KeyT &  k)
inline

◆ hasKey()

template<typename KeyT , typename CacheItemT >
bool LRUCache< KeyT, CacheItemT >::hasKey ( const KeyT &  k)
inline

Definition at line 47 of file lru_cache.hpp.

References LRUCache< KeyT, CacheItemT >::cache_.

◆ insert()

template<typename KeyT , typename CacheItemT >
bool LRUCache< KeyT, CacheItemT >::insert ( const KeyT &  key,
const CacheItemT &  value 
)
inline

◆ setCapacity()

template<typename KeyT , typename CacheItemT >
void LRUCache< KeyT, CacheItemT >::setCapacity ( std::size_t  capacity)
inline

Definition at line 128 of file lru_cache.hpp.

References LRUCache< KeyT, CacheItemT >::capacity_.

◆ sizeOf()

template<typename KeyT , typename CacheItemT >
std::size_t LRUCache< KeyT, CacheItemT >::sizeOf ( const CacheItemT &  value)
inline

Definition at line 141 of file lru_cache.hpp.

◆ tailItem()

template<typename KeyT , typename CacheItemT >
CacheItemT& LRUCache< KeyT, CacheItemT >::tailItem ( )
inline

◆ touch()

template<typename KeyT , typename CacheItemT >
void LRUCache< KeyT, CacheItemT >::touch ( const KeyT &  key)
inline

Member Data Documentation

◆ cache_

template<typename KeyT , typename CacheItemT >
Cache LRUCache< KeyT, CacheItemT >::cache_

◆ capacity_

template<typename KeyT , typename CacheItemT >
std::size_t LRUCache< KeyT, CacheItemT >::capacity_

◆ key_index_

template<typename KeyT , typename CacheItemT >
KeyIndex LRUCache< KeyT, CacheItemT >::key_index_

◆ size_

template<typename KeyT , typename CacheItemT >
std::size_t LRUCache< KeyT, CacheItemT >::size_ {0}

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