TARAXA
Loading...
Searching...
No Matches
taraxa::VerifiedVotes Class Reference

#include <verified_votes.hpp>

Public Member Functions

 VerifiedVotes (addr_t node_addr)
 
uint64_t size () const
 
std::vector< std::shared_ptr< PbftVote > > votes () const
 
std::optional< const RoundVerifiedVotesMapgetPeriodVotes (PbftPeriod period) const
 
std::optional< const RoundVerifiedVotesgetRoundVotes (PbftPeriod period, PbftRound round) const
 
std::optional< const StepVotesgetStepVotes (PbftPeriod period, PbftRound round, PbftStep step) const
 
std::optional< VotedBlockgetTwoTPlusOneVotedBlock (PbftPeriod period, PbftRound round, TwoTPlusOneVotedBlockType type) const
 
std::vector< std::shared_ptr< PbftVote > > getTwoTPlusOneVotedBlockVotes (PbftPeriod period, PbftRound round, TwoTPlusOneVotedBlockType type) const
 
void cleanupVotesByPeriod (PbftPeriod pbft_period)
 
std::optional< std::shared_ptr< PbftVote > > insertUniqueVoter (const std::shared_ptr< PbftVote > &vote)
 
std::optional< VotesWithWeightinsertVotedValue (const std::shared_ptr< PbftVote > &vote)
 
void setNetworkTPlusOneStep (std::shared_ptr< PbftVote > vote)
 
void insertTwoTPlusOneVotedBlock (TwoTPlusOneVotedBlockType type, std::shared_ptr< PbftVote > vote)
 

Private Member Functions

std::pair< bool, PeriodVerifiedVotesMap::iterator > get (PbftPeriod period)
 
std::pair< bool, PeriodVerifiedVotesMap::const_iterator > get (PbftPeriod period) const
 
std::pair< bool, RoundVerifiedVotesMap::iterator > get (PbftPeriod period, PbftRound round)
 
std::pair< bool, RoundVerifiedVotesMap::const_iterator > get (PbftPeriod period, PbftRound round) const
 
std::pair< bool, StepVotesMap::iterator > get (PbftPeriod period, PbftRound round, PbftStep step)
 
std::pair< bool, StepVotesMap::const_iterator > get (PbftPeriod period, PbftRound round, PbftStep step) const
 

Private Attributes

std::shared_mutex verified_votes_access_
 
PeriodVerifiedVotesMap verified_votes_
 

Constructor & Destructor Documentation

◆ VerifiedVotes()

taraxa::VerifiedVotes::VerifiedVotes ( addr_t  node_addr)
inline

Member Function Documentation

◆ cleanupVotesByPeriod()

void taraxa::VerifiedVotes::cleanupVotesByPeriod ( PbftPeriod  pbft_period)

◆ get() [1/6]

std::pair< bool, PeriodVerifiedVotesMap::iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period)
private

◆ get() [2/6]

std::pair< bool, PeriodVerifiedVotesMap::const_iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period) const
private

◆ get() [3/6]

std::pair< bool, RoundVerifiedVotesMap::iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period,
PbftRound  round 
)
private

◆ get() [4/6]

std::pair< bool, RoundVerifiedVotesMap::const_iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period,
PbftRound  round 
) const
private

◆ get() [5/6]

std::pair< bool, StepVotesMap::iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period,
PbftRound  round,
PbftStep  step 
)
private

◆ get() [6/6]

std::pair< bool, StepVotesMap::const_iterator > taraxa::VerifiedVotes::get ( PbftPeriod  period,
PbftRound  round,
PbftStep  step 
) const
private

◆ getPeriodVotes()

std::optional< const RoundVerifiedVotesMap > taraxa::VerifiedVotes::getPeriodVotes ( PbftPeriod  period) const

◆ getRoundVotes()

std::optional< const RoundVerifiedVotes > taraxa::VerifiedVotes::getRoundVotes ( PbftPeriod  period,
PbftRound  round 
) const

◆ getStepVotes()

std::optional< const StepVotes > taraxa::VerifiedVotes::getStepVotes ( PbftPeriod  period,
PbftRound  round,
PbftStep  step 
) const

◆ getTwoTPlusOneVotedBlock()

std::optional< VotedBlock > taraxa::VerifiedVotes::getTwoTPlusOneVotedBlock ( PbftPeriod  period,
PbftRound  round,
TwoTPlusOneVotedBlockType  type 
) const

◆ getTwoTPlusOneVotedBlockVotes()

std::vector< std::shared_ptr< PbftVote > > taraxa::VerifiedVotes::getTwoTPlusOneVotedBlockVotes ( PbftPeriod  period,
PbftRound  round,
TwoTPlusOneVotedBlockType  type 
) const

◆ insertTwoTPlusOneVotedBlock()

void taraxa::VerifiedVotes::insertTwoTPlusOneVotedBlock ( TwoTPlusOneVotedBlockType  type,
std::shared_ptr< PbftVote vote 
)

◆ insertUniqueVoter()

std::optional< std::shared_ptr< PbftVote > > taraxa::VerifiedVotes::insertUniqueVoter ( const std::shared_ptr< PbftVote > &  vote)

◆ insertVotedValue()

std::optional< VotesWithWeight > taraxa::VerifiedVotes::insertVotedValue ( const std::shared_ptr< PbftVote > &  vote)

◆ setNetworkTPlusOneStep()

void taraxa::VerifiedVotes::setNetworkTPlusOneStep ( std::shared_ptr< PbftVote vote)

◆ size()

uint64_t taraxa::VerifiedVotes::size ( ) const

◆ votes()

std::vector< std::shared_ptr< PbftVote > > taraxa::VerifiedVotes::votes ( ) const

Member Data Documentation

◆ verified_votes_

PeriodVerifiedVotesMap taraxa::VerifiedVotes::verified_votes_
private

◆ verified_votes_access_

std::shared_mutex taraxa::VerifiedVotes::verified_votes_access_
mutableprivate

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