#include "block_storage.hpp"


Public Types | |
| using | FunctionType = std::function< expected::Result< void, std::string >(std::shared_ptr< const shared_model::interface::Block >)> |
| type of function which can be applied to the elements of the storage More... | |
Public Member Functions | |
| virtual bool | insert (std::shared_ptr< const shared_model::interface::Block > block)=0 |
| virtual boost::optional< std::unique_ptr< shared_model::interface::Block > > | fetch (shared_model::interface::types::HeightType height) const =0 |
| virtual size_t | size () const =0 |
| virtual void | reload ()=0 |
| virtual void | clear ()=0 |
| virtual expected::Result< void, std::string > | forEach (FunctionType function) const =0 |
| virtual | ~BlockStorage ()=default |
Append-only block storage interface
| using iroha::ametsuchi::BlockStorage::FunctionType = std::function<expected::Result<void, std::string>( std::shared_ptr<const shared_model::interface::Block>)> |
type of function which can be applied to the elements of the storage
|
virtualdefault |
|
pure virtual |
Clears the contents of storage
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.
|
pure virtual |
Get block with given height
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.

|
pure virtual |
Iterates through all the stored blocks
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.
|
pure virtual |
Append block, if the storage doesn't already contain the same block
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.
|
pure virtual |
Reloads blocks in case their were modified externally
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.

|
pure virtual |
Returns the size of the storage
Implemented in iroha::ametsuchi::PostgresBlockStorage, iroha::ametsuchi::FlatFileBlockStorage, and iroha::ametsuchi::InMemoryBlockStorage.
