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

#include "cluster_order.hpp"

Collaboration diagram for iroha::consensus::yac::ClusterOrdering:
Collaboration graph

Public Member Functions

const shared_model::interface::PeercurrentLeader ()
 
ClusterOrderingswitchToNext ()
 
bool hasNext () const
 
const shared_model::interface::types::PeerListgetPeers () const
 
PeersNumberType getNumberOfPeers () const
 
virtual ~ClusterOrdering ()=default
 
 ClusterOrdering ()=delete
 

Static Public Member Functions

static boost::optional< ClusterOrderingcreate (std::vector< std::shared_ptr< shared_model::interface::Peer >> const &order, std::vector< size_t > const &peer_positions)
 
static boost::optional< ClusterOrderingcreate (std::vector< std::shared_ptr< shared_model::interface::Peer >> const &order)
 

Detailed Description

Class provide ordering on cluster for current round

Constructor & Destructor Documentation

◆ ~ClusterOrdering()

virtual iroha::consensus::yac::ClusterOrdering::~ClusterOrdering ( )
virtualdefault

◆ ClusterOrdering()

iroha::consensus::yac::ClusterOrdering::ClusterOrdering ( )
delete
Here is the caller graph for this function:

Member Function Documentation

◆ create() [1/2]

boost::optional< ClusterOrdering > iroha::consensus::yac::ClusterOrdering::create ( std::vector< std::shared_ptr< shared_model::interface::Peer >> const &  order,
std::vector< size_t > const &  peer_positions 
)
static

Creates cluster ordering from the vector of peers and peer positions

Parameters
ordervector of peers
peer_positionsvector of indexes of peer positions
Returns
ClusterOrdering if vectors are not empty, null otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/2]

boost::optional< ClusterOrdering > iroha::consensus::yac::ClusterOrdering::create ( std::vector< std::shared_ptr< shared_model::interface::Peer >> const &  order)
static

Creates cluster ordering from the vector of peers

Parameters
ordervector of peers
Returns
ClusterOrdering if vectors are not empty, null otherwise
Here is the call graph for this function:

◆ currentLeader()

const shared_model::interface::Peer & iroha::consensus::yac::ClusterOrdering::currentLeader ( )

Provide current leader peer

◆ getNumberOfPeers()

size_t iroha::consensus::yac::ClusterOrdering::getNumberOfPeers ( ) const
Here is the caller graph for this function:

◆ getPeers()

const shared_model::interface::types::PeerList & iroha::consensus::yac::ClusterOrdering::getPeers ( ) const
Here is the caller graph for this function:

◆ hasNext()

bool iroha::consensus::yac::ClusterOrdering::hasNext ( ) const
Returns
true if current leader not last peer in order

◆ switchToNext()

ClusterOrdering & iroha::consensus::yac::ClusterOrdering::switchToNext ( )

Switch to next peer as leader

Returns
this

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