hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::FlatFileBlockStorage Class Reference

#include "flat_file_block_storage.hpp"

Inheritance diagram for iroha::ametsuchi::FlatFileBlockStorage:
Inheritance graph
Collaboration diagram for iroha::ametsuchi::FlatFileBlockStorage:
Collaboration graph

Public Member Functions

 FlatFileBlockStorage (std::unique_ptr< FlatFile > flat_file, std::shared_ptr< shared_model::interface::BlockJsonConverter > json_converter, logger::LoggerPtr log)
 
 ~FlatFileBlockStorage () override
 
bool insert (std::shared_ptr< const shared_model::interface::Block > block) override
 
boost::optional< std::shared_ptr< const shared_model::interface::Block > > fetch (shared_model::interface::types::HeightType height) const override
 
size_t size () const override
 
void clear () override
 
void forEach (FunctionType function) const override
 
- Public Member Functions inherited from iroha::ametsuchi::BlockStorage
virtual ~BlockStorage ()=default
 

Additional Inherited Members

- Public Types inherited from iroha::ametsuchi::BlockStorage
using FunctionType = std::function< void(std::shared_ptr< const shared_model::interface::Block >)>
 type of function which can be applied to the elements of the storage More...
 

Constructor & Destructor Documentation

FlatFileBlockStorage::FlatFileBlockStorage ( std::unique_ptr< FlatFile flat_file,
std::shared_ptr< shared_model::interface::BlockJsonConverter json_converter,
logger::LoggerPtr  log 
)
FlatFileBlockStorage::~FlatFileBlockStorage ( )
override

Member Function Documentation

void FlatFileBlockStorage::clear ( )
overridevirtual

Clears the contents of storage

Implements iroha::ametsuchi::BlockStorage.

boost::optional< std::shared_ptr< const shared_model::interface::Block > > FlatFileBlockStorage::fetch ( shared_model::interface::types::HeightType  height) const
overridevirtual

Get block with given height

Returns
block if exists, boost::none otherwise

Implements iroha::ametsuchi::BlockStorage.

Here is the call graph for this function:

Here is the caller graph for this function:

void FlatFileBlockStorage::forEach ( FunctionType  function) const
overridevirtual

Iterates through all the stored blocks

Implements iroha::ametsuchi::BlockStorage.

Here is the call graph for this function:

bool FlatFileBlockStorage::insert ( std::shared_ptr< const shared_model::interface::Block block)
overridevirtual

Append block, if the storage doesn't already contain the same block

Returns
true if inserted successfully, false otherwise

Implements iroha::ametsuchi::BlockStorage.

size_t FlatFileBlockStorage::size ( ) const
overridevirtual

Returns the size of the storage

Implements iroha::ametsuchi::BlockStorage.


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