CatapultServer  v0.5.0.1 (Elephant)
catapult::io::BlockStorageCache Class Reference

Public Member Functions

 BlockStorageCache (std::unique_ptr< BlockStorage > &&pStorage, std::unique_ptr< PrunableBlockStorage > &&pStagingStorage)
 Creates a new cache around pStorage that uses pStagingStorage for staging blocks in order to enable two-phase commit. More...
 
 ~BlockStorageCache ()
 Destroys the cache. More...
 
BlockStorageView view () const
 Gets a read only view of the storage. More...
 
BlockStorageModifier modifier ()
 Gets a write only view of the storage. More...
 

Private Attributes

std::unique_ptr< BlockStoragem_pStorage
 
std::unique_ptr< PrunableBlockStoragem_pStagingStorage
 
std::unique_ptr< CachedDatam_pCachedData
 
utils::SpinReaderWriterLock m_lock
 

Detailed Description

A cache around a BlockStorage.

Note
Currently this "cache" provides synchronization and support for two-phase commit.

Constructor & Destructor Documentation

◆ BlockStorageCache()

catapult::io::BlockStorageCache::BlockStorageCache ( std::unique_ptr< BlockStorage > &&  pStorage,
std::unique_ptr< PrunableBlockStorage > &&  pStagingStorage 
)

Creates a new cache around pStorage that uses pStagingStorage for staging blocks in order to enable two-phase commit.

◆ ~BlockStorageCache()

catapult::io::BlockStorageCache::~BlockStorageCache ( )
default

Destroys the cache.

Member Function Documentation

◆ modifier()

BlockStorageModifier catapult::io::BlockStorageCache::modifier ( )

Gets a write only view of the storage.

Here is the call graph for this function:

◆ view()

BlockStorageView catapult::io::BlockStorageCache::view ( ) const

Gets a read only view of the storage.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_lock

utils::SpinReaderWriterLock catapult::io::BlockStorageCache::m_lock
mutableprivate

◆ m_pCachedData

std::unique_ptr<CachedData> catapult::io::BlockStorageCache::m_pCachedData
private

◆ m_pStagingStorage

std::unique_ptr<PrunableBlockStorage> catapult::io::BlockStorageCache::m_pStagingStorage
private

◆ m_pStorage

std::unique_ptr<BlockStorage> catapult::io::BlockStorageCache::m_pStorage
private

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