veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::BlockIterator< BlockT > Struct Template Referenceabstract

An abstraction over on-disk storage block iterator. More...

Detailed Description

template<typename BlockT>
struct altintegration::BlockIterator< BlockT >

veriblock-pop-cpp does not dictate how to iterate blocks over the storage. Altchain must create derived class.

Definition at line 25 of file block_iterator.hpp.

#include <block_iterator.hpp>

+ Inheritance diagram for altintegration::BlockIterator< BlockT >:
+ Collaboration diagram for altintegration::BlockIterator< BlockT >:

Public Types

using prev_hash_t = typename BlockT::hash_t
 

Public Member Functions

virtual void next ()=0
 Iterate to the next block. More...
 
virtual bool value (StoredBlockIndex< BlockT > &out) const =0
 Return the current block value. More...
 
virtual bool key (prev_hash_t &out) const =0
 Return the current block hash key. More...
 
virtual bool valid () const =0
 Return if valid iterator or not. More...
 
virtual void seek_start ()=0
 Set iterator to the start of the collection. More...
 

Member Typedef Documentation

◆ prev_hash_t

template<typename BlockT >
using altintegration::BlockIterator< BlockT >::prev_hash_t = typename BlockT::hash_t

Definition at line 26 of file block_iterator.hpp.

Member Function Documentation

◆ key()

template<typename BlockT >
virtual bool altintegration::BlockIterator< BlockT >::key ( prev_hash_t &  out) const
pure virtual
Parameters
[out]outblock hash
Returns
true if we can successfully return key, false otherwise

Implemented in altintegration::adaptors::BlockIteratorImpl< BlockT >.

◆ next()

template<typename BlockT >
virtual void altintegration::BlockIterator< BlockT >::next ( )
pure virtual

◆ seek_start()

template<typename BlockT >
virtual void altintegration::BlockIterator< BlockT >::seek_start ( )
pure virtual

◆ valid()

template<typename BlockT >
virtual bool altintegration::BlockIterator< BlockT >::valid ( ) const
pure virtual
Returns
true if the iterator is valid, false otherwise

Implemented in altintegration::adaptors::BlockIteratorImpl< BlockT >.

◆ value()

template<typename BlockT >
virtual bool altintegration::BlockIterator< BlockT >::value ( StoredBlockIndex< BlockT > &  out) const
pure virtual
Parameters
[out]outblock, altintegration::StoredBlockIndex
Returns
true if we can successfully return value, false otherwise

Implemented in altintegration::adaptors::BlockIteratorImpl< BlockT >.


The documentation for this struct was generated from the following file: