6 #ifndef IROHA_BLOCK_STORAGE_HPP 7 #define IROHA_BLOCK_STORAGE_HPP 9 #include <boost/optional/optional_fwd.hpp> 30 std::shared_ptr<const shared_model::interface::Block> block) = 0;
36 virtual boost::optional<std::unique_ptr<shared_model::interface::Block>>
42 virtual size_t size()
const = 0;
52 virtual void clear() = 0;
55 using FunctionType = std::function<expected::Result<void, std::string>(
56 std::shared_ptr<const shared_model::interface::Block>)>;
70 #endif // IROHA_BLOCK_STORAGE_HPP Definition: block_query.hpp:17
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:48
virtual ~BlockStorage()=default
std::function< expected::Result< void, std::string >(std::shared_ptr< const shared_model::interface::Block >)> FunctionType
type of function which can be applied to the elements of the storage
Definition: block_storage.hpp:56
Definition: block_storage.hpp:23
Definition: result_fwd.hpp:27
virtual size_t size() const =0
Definition: block_query.hpp:15
virtual expected::Result< void, std::string > forEach(FunctionType function) const =0
virtual boost::optional< std::unique_ptr< shared_model::interface::Block > > fetch(shared_model::interface::types::HeightType height) const =0
virtual bool insert(std::shared_ptr< const shared_model::interface::Block > block)=0