CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::CacheStorageAdapter< TCache, TStorageTraits > Class Template Reference

A CacheStorage implementation that wraps a cache and associated storage traits. More...

Inheritance diagram for catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >:
Collaboration diagram for catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >:

Public Member Functions

 CacheStorageAdapter (TCache &cache)
 Creates an adapter around cache. More...
 
const std::string & name () const override
 Gets the cache name. More...
 
void saveAll (const CatapultCacheView &cacheView, io::OutputStream &output) const override
 Saves cache data from cacheView to output. More...
 
void saveSummary (const CatapultCacheDelta &, io::OutputStream &) const override
 Saves cache (summary) data from cacheDelta to output. More...
 
void loadAll (io::InputStream &input, size_t batchSize) override
 Loads cache data from input in batches of batchSize. More...
 
- Public Member Functions inherited from catapult::cache::CacheStorage
virtual ~CacheStorage ()=default
 

Static Private Member Functions

template<typename T >
static void SaveValue (const T &value, io::OutputStream &output)
 
template<typename T1 , typename T2 >
static void SaveValue (const std::pair< T1, T2 > &pair, io::OutputStream &output)
 

Private Attributes

TCache & m_cache
 
std::string m_name
 

Detailed Description

template<typename TCache, typename TStorageTraits>
class catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >

A CacheStorage implementation that wraps a cache and associated storage traits.

Constructor & Destructor Documentation

◆ CacheStorageAdapter()

template<typename TCache, typename TStorageTraits>
catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::CacheStorageAdapter ( TCache &  cache)
inlineexplicit

Creates an adapter around cache.

Member Function Documentation

◆ loadAll()

template<typename TCache, typename TStorageTraits>
void catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::loadAll ( io::InputStream input,
size_t  batchSize 
)
inlineoverridevirtual

Loads cache data from input in batches of batchSize.

Implements catapult::cache::CacheStorage.

◆ name()

template<typename TCache, typename TStorageTraits>
const std::string& catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::name ( ) const
inlineoverridevirtual

Gets the cache name.

Implements catapult::cache::CacheStorage.

◆ saveAll()

template<typename TCache, typename TStorageTraits>
void catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::saveAll ( const CatapultCacheView cacheView,
io::OutputStream output 
) const
inlineoverridevirtual

Saves cache data from cacheView to output.

Implements catapult::cache::CacheStorage.

◆ saveSummary()

template<typename TCache, typename TStorageTraits>
void catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::saveSummary ( const CatapultCacheDelta cacheDelta,
io::OutputStream output 
) const
inlineoverridevirtual

Saves cache (summary) data from cacheDelta to output.

Implements catapult::cache::CacheStorage.

◆ SaveValue() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename T1 , typename T2 >
static void catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::SaveValue ( const std::pair< T1, T2 > &  pair,
io::OutputStream output 
)
inlinestaticprivate

◆ SaveValue() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename T >
static void catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::SaveValue ( const T &  value,
io::OutputStream output 
)
inlinestaticprivate
Here is the caller graph for this function:

Member Data Documentation

◆ m_cache

template<typename TCache, typename TStorageTraits>
TCache& catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::m_cache
private

◆ m_name

template<typename TCache, typename TStorageTraits>
std::string catapult::cache::CacheStorageAdapter< TCache, TStorageTraits >::m_name
private

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