CatapultServer  v0.5.0.1 (Elephant)
catapult::io::BlockStorage Class Referenceabstract

Interface for saving and loading blocks. More...

Inheritance diagram for catapult::io::BlockStorage:
Collaboration diagram for catapult::io::BlockStorage:

Public Member Functions

virtual std::shared_ptr< const model::BlockloadBlock (Height height) const =0
 Returns the block at height. More...
 
virtual std::shared_ptr< const model::BlockElementloadBlockElement (Height height) const =0
 Returns the block element (owning a block) at height. More...
 
virtual std::pair< std::vector< uint8_t >, bool > loadBlockStatementData (Height height) const =0
 Returns the optional block statement data at height. More...
 
- Public Member Functions inherited from catapult::io::LightBlockStorage
virtual ~LightBlockStorage ()=default
 
virtual Height chainHeight () const =0
 Gets the number of blocks. More...
 
virtual model::HashRange loadHashesFrom (Height height, size_t maxHashes) const =0
 Returns a range of at most maxHashes hashes starting at height. More...
 
virtual void saveBlock (const model::BlockElement &blockElement)=0
 Saves blockElement. More...
 
virtual void dropBlocksAfter (Height height)=0
 Drops all blocks after height. More...
 
- Public Member Functions inherited from catapult::utils::NonCopyable
constexpr NonCopyable ()=default
 Default constructor. More...
 
 ~NonCopyable ()=default
 Default destructor. More...
 
 NonCopyable (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
NonCopyableoperator= (const NonCopyable &)=delete
 Disabled assignment operator. More...
 

Detailed Description

Interface for saving and loading blocks.

Member Function Documentation

◆ loadBlock()

virtual std::shared_ptr<const model::Block> catapult::io::BlockStorage::loadBlock ( Height  height) const
pure virtual

Returns the block at height.

Implemented in catapult::io::FileBlockStorage, and catapult::extensions::MemoryBlockStorage.

Here is the caller graph for this function:

◆ loadBlockElement()

virtual std::shared_ptr<const model::BlockElement> catapult::io::BlockStorage::loadBlockElement ( Height  height) const
pure virtual

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

Implemented in catapult::io::FileBlockStorage, and catapult::extensions::MemoryBlockStorage.

Here is the caller graph for this function:

◆ loadBlockStatementData()

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

Returns the optional block statement data at height.

Implemented in catapult::io::FileBlockStorage, and catapult::extensions::MemoryBlockStorage.

Here is the caller graph for this function:

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