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, shared_model::interface::BatchHashEqualitygetBatches () const
 
MstState extractExpired (const TimeType &current_time)
 
void eraseExpired (const TimeType &current_time)
 
void eraseByTransactionHash (const shared_model::interface::types::HashType &hash)
 
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

◆ contains()

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:

◆ empty()

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:

◆ eraseByTransactionHash()

void iroha::MstState::eraseByTransactionHash ( const shared_model::interface::types::HashType hash)

Erase batch by transaction hash

◆ eraseExpired()

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

Erase expired batches

Parameters
current_time- current time
Here is the caller graph for this function:

◆ extractExpired()

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:

◆ getBatches()

std::unordered_set< DataType, iroha::model::PointerBatchHasher, shared_model::interface::BatchHashEquality > iroha::MstState::getBatches ( ) const
Returns
the batches from the state
Here is the caller graph for this function:

◆ isEmpty()

bool iroha::MstState::isEmpty ( ) const
Returns
true, if there is no batches inside
Here is the caller graph for this function:

◆ iterateBatches()

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

Apply visitor to all batches.

◆ iterateTransactions()

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

Apply visitor to all transactions.

Here is the caller graph for this function:

◆ operator+=() [1/2]

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:

◆ operator+=() [2/2]

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:

◆ operator-()

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: