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

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

Inheritance diagram for catapult::io::BlockStorageView:
Collaboration diagram for catapult::io::BlockStorageView:

Public Member Functions

 BlockStorageView (const BlockStorage &storage, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock, const CachedData &cachedData)
 Creates a view around storage and cache data (cachedData) with lock context readLock. More...
 
Height chainHeight () const
 Gets the number of blocks. More...
 
model::HashRange loadHashesFrom (Height height, size_t maxHashes) const
 Returns a range of at most maxHashes hashes starting at height. More...
 
std::shared_ptr< const model::BlockloadBlock (Height height) const
 Returns the block at height. More...
 
std::shared_ptr< const model::BlockElementloadBlockElement (Height height) const
 Returns the block element (owning a block) at height. More...
 
std::pair< std::vector< uint8_t >, bool > loadBlockStatementData (Height height) const
 Returns the optional block statement data at height. More...
 

Private Member Functions

void requireHeight (Height height, const char *description) const
 
- 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...
 

Private Attributes

const BlockStoragem_storage
 
utils::SpinReaderWriterLock::ReaderLockGuard m_readLock
 
const CachedDatam_cachedData
 

Detailed Description

A read only view on top of block storage.

Constructor & Destructor Documentation

◆ BlockStorageView()

catapult::io::BlockStorageView::BlockStorageView ( const BlockStorage storage,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock,
const CachedData cachedData 
)
explicit

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

Member Function Documentation

◆ chainHeight()

Height catapult::io::BlockStorageView::chainHeight ( ) const

Gets the number of blocks.

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

◆ loadBlock()

std::shared_ptr< const model::Block > catapult::io::BlockStorageView::loadBlock ( Height  height) const

Returns the block at height.

Here is the call graph for this function:

◆ loadBlockElement()

std::shared_ptr< const model::BlockElement > catapult::io::BlockStorageView::loadBlockElement ( Height  height) const

Returns the block element (owning a block) at height.

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

◆ loadBlockStatementData()

std::pair< std::vector< uint8_t >, bool > catapult::io::BlockStorageView::loadBlockStatementData ( Height  height) const

Returns the optional block statement data at height.

Here is the call graph for this function:

◆ loadHashesFrom()

model::HashRange catapult::io::BlockStorageView::loadHashesFrom ( Height  height,
size_t  maxHashes 
) const

Returns a range of at most maxHashes hashes starting at height.

Here is the call graph for this function:

◆ requireHeight()

void catapult::io::BlockStorageView::requireHeight ( Height  height,
const char *  description 
) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_cachedData

const CachedData& catapult::io::BlockStorageView::m_cachedData
private

◆ m_readLock

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

◆ m_storage

const BlockStorage& catapult::io::BlockStorageView::m_storage
private

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