CatapultServer
v0.5.0.1 (Elephant)
|
A read only view on top of block storage. More...
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::Block > | loadBlock (Height height) const |
Returns the block at height. More... | |
std::shared_ptr< const model::BlockElement > | loadBlockElement (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... | |
MoveOnly & | operator= (const MoveOnly &)=delete |
Disabled assignment operator. More... | |
MoveOnly & | operator= (MoveOnly &&)=default |
Default move assignment operator. More... | |
Private Attributes | |
const BlockStorage & | m_storage |
utils::SpinReaderWriterLock::ReaderLockGuard | m_readLock |
const CachedData & | m_cachedData |
A read only view on top of block storage.
|
explicit |
Creates a view around storage and cache data (cachedData) with lock context readLock.
Height catapult::io::BlockStorageView::chainHeight | ( | ) | const |
Gets the number of blocks.
std::shared_ptr< const model::Block > catapult::io::BlockStorageView::loadBlock | ( | Height | height | ) | const |
Returns the block at height.
std::shared_ptr< const model::BlockElement > catapult::io::BlockStorageView::loadBlockElement | ( | Height | height | ) | const |
Returns the block element (owning a block) at height.
std::pair< std::vector< uint8_t >, bool > catapult::io::BlockStorageView::loadBlockStatementData | ( | Height | height | ) | const |
Returns the optional block statement data at height.
model::HashRange catapult::io::BlockStorageView::loadHashesFrom | ( | Height | height, |
size_t | maxHashes | ||
) | const |
Returns a range of at most maxHashes hashes starting at height.
|
private |
|
private |
|
private |
|
private |