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

#include "in_memory_block_storage.hpp"

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

Public Member Functions

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...

Detailed Description

Ordered map implementation of block storage

Member Function Documentation

void InMemoryBlockStorage::clear ( )

Clears the contents of storage

Implements iroha::ametsuchi::BlockStorage.

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

Get block with given height

block if exists, boost::none otherwise

Implements iroha::ametsuchi::BlockStorage.

void InMemoryBlockStorage::forEach ( FunctionType  function) const

Iterates through all the stored blocks

Implements iroha::ametsuchi::BlockStorage.

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

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

true if inserted successfully, false otherwise

Implements iroha::ametsuchi::BlockStorage.

size_t InMemoryBlockStorage::size ( ) const

Returns the size of the storage

Implements iroha::ametsuchi::BlockStorage.

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