CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::CatapultCache Class Reference

Central cache holding all sub caches. More...

Public Member Functions

 CatapultCache (std::vector< std::unique_ptr< SubCachePlugin >> &&subCaches)
 Creates a catapult cache around subCaches. More...
 
 ~CatapultCache ()
 Destroys the cache. More...
 
 CatapultCache (CatapultCache &&)
 
CatapultCacheoperator= (CatapultCache &&)
 
template<typename TCache >
const TCache & sub () const
 Gets a specific sub cache. More...
 
CatapultCacheView createView () const
 Returns a locked cache view based on this cache. More...
 
CatapultCacheDelta createDelta ()
 Returns a locked cache delta based on this cache. More...
 
CatapultCacheDetachableDelta createDetachableDelta () const
 
void commit (Height height)
 Commits all pending changes to the underlying storage and sets the cache height to height. More...
 
std::vector< std::unique_ptr< const CacheStorage > > storages () const
 Gets cache storages for all sub caches. More...
 
std::vector< std::unique_ptr< CacheStorage > > storages ()
 Gets cache storages for all sub caches. More...
 
std::vector< std::unique_ptr< const CacheChangesStorage > > changesStorages () const
 Gets cache changes storages for all sub caches. More...
 

Private Attributes

std::unique_ptr< CacheHeightm_pCacheHeight
 
std::vector< std::unique_ptr< SubCachePlugin > > m_subCaches
 

Detailed Description

Central cache holding all sub caches.

Constructor & Destructor Documentation

◆ CatapultCache() [1/2]

catapult::cache::CatapultCache::CatapultCache ( std::vector< std::unique_ptr< SubCachePlugin >> &&  subCaches)
explicit

Creates a catapult cache around subCaches.

◆ ~CatapultCache()

catapult::cache::CatapultCache::~CatapultCache ( )
default

Destroys the cache.

◆ CatapultCache() [2/2]

catapult::cache::CatapultCache::CatapultCache ( CatapultCache &&  )
default

Member Function Documentation

◆ changesStorages()

std::vector< std::unique_ptr< const CacheChangesStorage > > catapult::cache::CatapultCache::changesStorages ( ) const

Gets cache changes storages for all sub caches.

◆ commit()

void catapult::cache::CatapultCache::commit ( Height  height)

Commits all pending changes to the underlying storage and sets the cache height to height.

Here is the caller graph for this function:

◆ createDelta()

CatapultCacheDelta catapult::cache::CatapultCache::createDelta ( )

Returns a locked cache delta based on this cache.

◆ createDetachableDelta()

CatapultCacheDetachableDelta catapult::cache::CatapultCache::createDetachableDelta ( ) const

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

Note
The detachable delta holds a cache reader lock.
Here is the caller graph for this function:

◆ createView()

CatapultCacheView catapult::cache::CatapultCache::createView ( ) const

Returns a locked cache view based on this cache.

Here is the caller graph for this function:

◆ operator=()

CatapultCache & catapult::cache::CatapultCache::operator= ( CatapultCache &&  )
default

◆ storages() [1/2]

std::vector< std::unique_ptr< CacheStorage > > catapult::cache::CatapultCache::storages ( )

Gets cache storages for all sub caches.

◆ storages() [2/2]

std::vector< std::unique_ptr< const CacheStorage > > catapult::cache::CatapultCache::storages ( ) const

Gets cache storages for all sub caches.

Here is the caller graph for this function:

◆ sub()

template<typename TCache >
const TCache& catapult::cache::CatapultCache::sub ( ) const
inline

Gets a specific sub cache.

Here is the caller graph for this function:

Member Data Documentation

◆ m_pCacheHeight

std::unique_ptr<CacheHeight> catapult::cache::CatapultCache::m_pCacheHeight
private

◆ m_subCaches

std::vector<std::unique_ptr<SubCachePlugin> > catapult::cache::CatapultCache::m_subCaches
private

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