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

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

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

Classes

class  ReadOnlyFindIterator
 Find iterator returned by ReadOnlyArtifactCache::find. More...
 

Public Member Functions

 ReadOnlyArtifactCache (const TCache &cache)
 Creates a read-only overlay on top of cache. More...
 
 ReadOnlyArtifactCache (const TCacheDelta &cache)
 Creates a read-only overlay on top of cache. More...
 
auto find (TKey id) const
 Finds the cache value identified by key. More...
 
bool isActive (TKey id, Height height) const
 Gets a value indicating whether or not an artifact with id is active at height. More...
 
- Public Member Functions inherited from catapult::cache::ReadOnlySimpleCache< TCache, TCacheDelta, TKey >
 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, typename TValue>
class catapult::cache::ReadOnlyArtifactCache< TCache, TCacheDelta, TKey, TValue >

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

Constructor & Destructor Documentation

◆ ReadOnlyArtifactCache() [1/2]

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

Creates a read-only overlay on top of cache.

◆ ReadOnlyArtifactCache() [2/2]

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

Creates a read-only overlay on top of cache.

Member Function Documentation

◆ find()

template<typename TCache, typename TCacheDelta, typename TKey, typename TValue>
auto catapult::cache::ReadOnlyArtifactCache< TCache, TCacheDelta, TKey, TValue >::find ( TKey  id) const
inline

Finds the cache value identified by key.

◆ isActive()

template<typename TCache, typename TCacheDelta, typename TKey, typename TValue>
bool catapult::cache::ReadOnlyArtifactCache< TCache, TCacheDelta, TKey, TValue >::isActive ( TKey  id,
Height  height 
) const
inline

Gets a value indicating whether or not an artifact with id is active at height.

Member Data Documentation

◆ m_pCache

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

◆ m_pCacheDelta

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

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