CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey > Class Template Reference

A read-only overlay on top of a cache that provides support for contains. More...

Inheritance diagram for catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >:
Collaboration diagram for catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >:

Public Member Functions

 ReadOnlySimpleCache (const TCache &cache)
 Creates a read-only overlay on top of cache. More...
 
 ReadOnlySimpleCache (const TCacheDelta &cache)
 Creates a read-only overlay on top of cache. More...
 
size_t size () const
 Returns the number of elements in the cache. More...
 
bool contains (const TKey &key) const
 

Private Attributes

const TCache * m_pCache
 
const TCacheDelta * m_pCacheDelta
 

Detailed Description

template<typename TCache, typename TCacheDelta, typename TKey>
class catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >

A read-only overlay on top of a cache that provides support for contains.

Constructor & Destructor Documentation

◆ ReadOnlySimpleCache() [1/2]

template<typename TCache, typename TCacheDelta, typename TKey>
catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::ReadOnlySimpleCache ( const TCache &  cache)
inlineexplicit

Creates a read-only overlay on top of cache.

◆ ReadOnlySimpleCache() [2/2]

template<typename TCache, typename TCacheDelta, typename TKey>
catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::ReadOnlySimpleCache ( const TCacheDelta &  cache)
inlineexplicit

Creates a read-only overlay on top of cache.

Member Function Documentation

◆ contains()

template<typename TCache, typename TCacheDelta, typename TKey>
bool catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::contains ( const TKey &  key) const
inline

Searches for the given key in the cache. Returns true if it is found or false otherwise.

◆ size()

template<typename TCache, typename TCacheDelta, typename TKey>
size_t catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::size ( ) const
inline

Returns the number of elements in the cache.

Member Data Documentation

◆ m_pCache

template<typename TCache, typename TCacheDelta, typename TKey>
const TCache* catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::m_pCache
private

◆ m_pCacheDelta

template<typename TCache, typename TCacheDelta, typename TKey>
const TCacheDelta* catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >::m_pCacheDelta
private

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