veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
block_iterator.hpp
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef VERIBLOCK_POP_CPP_STORAGE_ITERATOR_HPP
7#define VERIBLOCK_POP_CPP_STORAGE_ITERATOR_HPP
8
9#include <cstdint>
10#include <vector>
11
12namespace altintegration {
13
24template <typename BlockT>
26 using prev_hash_t = typename BlockT::hash_t;
27
28 virtual ~BlockIterator() = default;
29
33 virtual void next() = 0;
34
40 virtual bool value(StoredBlockIndex<BlockT>& out) const = 0;
41
47 virtual bool key(prev_hash_t& out) const = 0;
48
53 virtual bool valid() const = 0;
54
58 virtual void seek_start() = 0;
59};
60
61} // namespace altintegration
62
63#endif
Defines logging helpers.
Definition: block.hpp:14
An abstraction over on-disk storage block iterator.
virtual bool valid() const =0
Return if valid iterator or not.
virtual void seek_start()=0
Set iterator to the start of the collection.
virtual bool key(prev_hash_t &out) const =0
Return the current block hash key.
virtual bool value(StoredBlockIndex< BlockT > &out) const =0
Return the current block value.
virtual void next()=0
Iterate to the next block.