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

A write only view on top of block storage. More...

Inheritance diagram for catapult::io::BlockStorageModifier:
Collaboration diagram for catapult::io::BlockStorageModifier:

Public Member Functions

 BlockStorageModifier (BlockStorage &storage, PrunableBlockStorage &stagingStorage, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock, CachedData &cachedData)
 Creates a view around storage, stagingStorage and cache data (cachedData) with lock context readLock. More...
 
void saveBlock (const model::BlockElement &blockElement)
 Saves a block element (blockElement). More...
 
void saveBlocks (const std::vector< model::BlockElement > &blockElements)
 Saves multiple block elements (blockElements). More...
 
void dropBlocksAfter (Height height)
 Drops all blocks after height. More...
 
void commit ()
 Commits all staged changes to the primary storage. More...
 

Private Attributes

BlockStoragem_storage
 
PrunableBlockStoragem_stagingStorage
 
utils::SpinReaderWriterLock::ReaderLockGuard m_readLock
 
utils::SpinReaderWriterLock::WriterLockGuard m_writeLock
 
CachedDatam_cachedData
 
Height m_saveStartHeight
 

Additional Inherited Members

- Private Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 

Detailed Description

A write only view on top of block storage.

Constructor & Destructor Documentation

◆ BlockStorageModifier()

catapult::io::BlockStorageModifier::BlockStorageModifier ( BlockStorage storage,
PrunableBlockStorage stagingStorage,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock,
CachedData cachedData 
)

Creates a view around storage, stagingStorage and cache data (cachedData) with lock context readLock.

Here is the call graph for this function:

Member Function Documentation

◆ commit()

void catapult::io::BlockStorageModifier::commit ( )

Commits all staged changes to the primary storage.

Here is the call graph for this function:

◆ dropBlocksAfter()

void catapult::io::BlockStorageModifier::dropBlocksAfter ( Height  height)

Drops all blocks after height.

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

◆ saveBlock()

void catapult::io::BlockStorageModifier::saveBlock ( const model::BlockElement blockElement)

Saves a block element (blockElement).

Here is the call graph for this function:

◆ saveBlocks()

void catapult::io::BlockStorageModifier::saveBlocks ( const std::vector< model::BlockElement > &  blockElements)

Saves multiple block elements (blockElements).

Here is the call graph for this function:

Member Data Documentation

◆ m_cachedData

CachedData& catapult::io::BlockStorageModifier::m_cachedData
private

◆ m_readLock

utils::SpinReaderWriterLock::ReaderLockGuard catapult::io::BlockStorageModifier::m_readLock
private

◆ m_saveStartHeight

Height catapult::io::BlockStorageModifier::m_saveStartHeight
private

◆ m_stagingStorage

PrunableBlockStorage& catapult::io::BlockStorageModifier::m_stagingStorage
private

◆ m_storage

BlockStorage& catapult::io::BlockStorageModifier::m_storage
private

◆ m_writeLock

utils::SpinReaderWriterLock::WriterLockGuard catapult::io::BlockStorageModifier::m_writeLock
private

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