hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ordering::cache::OrderingGateCache Class Referenceabstract

#include "ordering_gate_cache.hpp"

Inheritance diagram for iroha::ordering::cache::OrderingGateCache:
Inheritance graph
Collaboration diagram for iroha::ordering::cache::OrderingGateCache:
Collaboration graph

Public Types

using BatchesSetType = std::unordered_set< std::shared_ptr< shared_model::interface::TransactionBatch >, BatchPointerHasher >
 
using HashesSetType = std::unordered_set< shared_model::crypto::Hash, shared_model::crypto::Hash::Hasher >
 

Public Member Functions

virtual void addToBack (const BatchesSetType &batches)=0
 
virtual BatchesSetType pop ()=0
 
virtual void remove (const HashesSetType &hashes)=0
 
virtual const BatchesSetTypehead () const =0
 
virtual const BatchesSetTypetail () const =0
 
virtual ~OrderingGateCache ()=default
 

Detailed Description

Cache for transactions sent to ordering gate

Member Typedef Documentation

using iroha::ordering::cache::OrderingGateCache::BatchesSetType = std::unordered_set< std::shared_ptr<shared_model::interface::TransactionBatch>, BatchPointerHasher>

type of the element in cache container. Set is used as it allows to remove batch from BatchSet with O(1) complexity, which is the case in remove method

Constructor & Destructor Documentation

virtual iroha::ordering::cache::OrderingGateCache::~OrderingGateCache ( )
virtualdefault

Member Function Documentation

virtual void iroha::ordering::cache::OrderingGateCache::addToBack ( const BatchesSetType batches)
pure virtual

Concatenates batches from the tail of the queue with provided batches

Implemented in iroha::ordering::cache::OnDemandCache.

virtual const BatchesSetType& iroha::ordering::cache::OrderingGateCache::head ( ) const
pure virtual

Return the head batches

Implemented in iroha::ordering::cache::OnDemandCache.

virtual BatchesSetType iroha::ordering::cache::OrderingGateCache::pop ( )
pure virtual

Pops the head batches and returns them

Implemented in iroha::ordering::cache::OnDemandCache.

virtual void iroha::ordering::cache::OrderingGateCache::remove ( const HashesSetType hashes)
pure virtual

Removes batches by provided hashes from the head of the queue

Implemented in iroha::ordering::cache::OnDemandCache.

virtual const BatchesSetType& iroha::ordering::cache::OrderingGateCache::tail ( ) const
pure virtual

Return the tail batches

Implemented in iroha::ordering::cache::OnDemandCache.


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