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

A SubCachePlugin implementation that wraps a SynchronizedCache. More...

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

Classes

class  DetachedSubCacheViewAdapter
 
class  SubCacheViewAdapter
 

Public Member Functions

 SubCachePluginAdapter (std::unique_ptr< TCache > &&pCache)
 Creates an adapter around pCache. More...
 
const std::string & name () const override
 Gets the cache name. More...
 
size_t id () const override
 Gets the cache id. More...
 
std::unique_ptr< const SubCacheViewcreateView () const override
 Returns a locked cache view based on this cache. More...
 
std::unique_ptr< SubCacheViewcreateDelta () override
 
std::unique_ptr< DetachedSubCacheViewcreateDetachedDelta () const override
 
void commit () override
 Commits all pending changes to the underlying storage. More...
 
const void * get () const override
 Returns a const pointer to the underlying cache. More...
 
std::unique_ptr< CacheStoragecreateStorage () override
 Returns a cache storage based on this cache. More...
 
std::unique_ptr< CacheChangesStoragecreateChangesStorage () const override
 Returns a cache changes storage based on this cache. More...
 
TCache & cache ()
 Gets a typed reference to the underlying cache. More...
 
- Public Member Functions inherited from catapult::cache::SubCachePlugin
virtual ~SubCachePlugin ()=default
 

Private Member Functions

auto makeSubCacheViewIdentifier (SubCacheViewType viewType) const
 

Static Private Member Functions

static bool IsCacheStorageSupported (const TCache &cache)
 

Private Attributes

std::unique_ptr< TCache > m_pCache
 
std::string m_name
 

Detailed Description

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

A SubCachePlugin implementation that wraps a SynchronizedCache.

Constructor & Destructor Documentation

◆ SubCachePluginAdapter()

template<typename TCache, typename TStorageTraits>
catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCachePluginAdapter ( std::unique_ptr< TCache > &&  pCache)
inlineexplicit

Creates an adapter around pCache.

Member Function Documentation

◆ cache()

template<typename TCache, typename TStorageTraits>
TCache& catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::cache ( )
inline

Gets a typed reference to the underlying cache.

Here is the caller graph for this function:

◆ commit()

template<typename TCache, typename TStorageTraits>
void catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::commit ( )
inlineoverridevirtual

Commits all pending changes to the underlying storage.

Implements catapult::cache::SubCachePlugin.

◆ createChangesStorage()

template<typename TCache, typename TStorageTraits>
std::unique_ptr<CacheChangesStorage> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::createChangesStorage ( ) const
inlineoverridevirtual

Returns a cache changes storage based on this cache.

Implements catapult::cache::SubCachePlugin.

◆ createDelta()

template<typename TCache, typename TStorageTraits>
std::unique_ptr<SubCacheView> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::createDelta ( )
inlineoverridevirtual

Returns a locked cache delta based on this cache.

Note
Changes to an attached delta can be committed by calling commit.

Implements catapult::cache::SubCachePlugin.

◆ createDetachedDelta()

template<typename TCache, typename TStorageTraits>
std::unique_ptr<DetachedSubCacheView> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::createDetachedDelta ( ) const
inlineoverridevirtual

Returns a lockable cache delta based on this cache but without the ability to commit any changes to the original cache.

Implements catapult::cache::SubCachePlugin.

◆ createStorage()

template<typename TCache, typename TStorageTraits>
std::unique_ptr<CacheStorage> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::createStorage ( )
inlineoverridevirtual

Returns a cache storage based on this cache.

Implements catapult::cache::SubCachePlugin.

Reimplemented in catapult::cache::SummaryAwareSubCachePluginAdapter< TCache, TStorageTraits, TSummaryCacheStorage >.

Here is the caller graph for this function:

◆ createView()

template<typename TCache, typename TStorageTraits>
std::unique_ptr<const SubCacheView> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::createView ( ) const
inlineoverridevirtual

Returns a locked cache view based on this cache.

Implements catapult::cache::SubCachePlugin.

◆ get()

template<typename TCache, typename TStorageTraits>
const void* catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::get ( ) const
inlineoverridevirtual

Returns a const pointer to the underlying cache.

Implements catapult::cache::SubCachePlugin.

◆ id()

template<typename TCache, typename TStorageTraits>
size_t catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::id ( ) const
inlineoverridevirtual

Gets the cache id.

Implements catapult::cache::SubCachePlugin.

Here is the caller graph for this function:

◆ IsCacheStorageSupported()

template<typename TCache, typename TStorageTraits>
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::IsCacheStorageSupported ( const TCache &  cache)
inlinestaticprivate
Here is the caller graph for this function:

◆ makeSubCacheViewIdentifier()

template<typename TCache, typename TStorageTraits>
auto catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::makeSubCacheViewIdentifier ( SubCacheViewType  viewType) const
inlineprivate
Here is the caller graph for this function:

◆ name()

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

Gets the cache name.

Implements catapult::cache::SubCachePlugin.

Here is the caller graph for this function:

Member Data Documentation

◆ m_name

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

◆ m_pCache

template<typename TCache, typename TStorageTraits>
std::unique_ptr<TCache> catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::m_pCache
private

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