hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::MstState Class Reference

#include "mst_state.hpp"

Collaboration diagram for iroha::MstState:
Collaboration graph

Public Member Functions

StateUpdateResult operator+= (const DataType &rhs)
 
StateUpdateResult operator+= (const MstState &rhs)
 
MstState operator- (const MstState &rhs) const
 
bool isEmpty () const
 
std::unordered_set< DataType, iroha::model::PointerBatchHasher, BatchHashEqualitygetBatches () const
 
MstState extractExpired (const TimeType &current_time)
 
void eraseExpired (const TimeType &current_time)
 
bool contains (const DataType &element) const
 
template<typename Visitor >
void iterateBatches (const Visitor &visitor) const
 Apply visitor to all batches. More...
 
template<typename Visitor >
void iterateTransactions (const Visitor &visitor) const
 Apply visitor to all transactions. More...
 

Static Public Member Functions

static MstState empty (logger::LoggerPtr log, const CompleterType &completer)
 

Member Function Documentation

bool iroha::MstState::contains ( const DataType element) const

Check, if this MST state contains that element

Parameters
elementto be checked
Returns
true, if state contains the element, false otherwise

Here is the caller graph for this function:

MstState iroha::MstState::empty ( logger::LoggerPtr  log,
const CompleterType completer 
)
static

Create empty state

Parameters
log- the logger to use in the new object
completer- strategy for determine completed and expired batches
Returns
empty mst state

Here is the caller graph for this function:

void iroha::MstState::eraseExpired ( const TimeType current_time)

Erase expired batches

Parameters
current_time- current time

Here is the caller graph for this function:

MstState iroha::MstState::extractExpired ( const TimeType current_time)

Erase and return expired batches

Parameters
current_time- current time
Returns
state with expired batches

Here is the call graph for this function:

Here is the caller graph for this function:

std::unordered_set< DataType, iroha::model::PointerBatchHasher, BatchHashEquality > iroha::MstState::getBatches ( ) const
Returns
the batches from the state

Here is the caller graph for this function:

bool iroha::MstState::isEmpty ( ) const
Returns
true, if there is no batches inside

Here is the caller graph for this function:

template<typename Visitor >
void iroha::MstState::iterateBatches ( const Visitor &  visitor) const
inline

Apply visitor to all batches.

template<typename Visitor >
void iroha::MstState::iterateTransactions ( const Visitor &  visitor) const
inline

Apply visitor to all transactions.

StateUpdateResult iroha::MstState::operator+= ( const DataType rhs)

Add batch to current state

Parameters
rhs- batch for insertion
Returns
States with completed and updated batches

Here is the call graph for this function:

StateUpdateResult iroha::MstState::operator+= ( const MstState rhs)

Concat internal data of states

Parameters
rhs- object for merging
Returns
States with completed and updated batches

Here is the call graph for this function:

MstState iroha::MstState::operator- ( const MstState rhs) const

Operator provide difference between this and rhs operator

Parameters
rhs,statefor removing
Returns
State that provide difference between left and right states axiom operators: A V B == B V A A V B == B V (A \ B)

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