hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
buffered_cleanup_strategy.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_BUFFERED_CLEANUP_STRATEGY_HPP
7 #define IROHA_BUFFERED_CLEANUP_STRATEGY_HPP
8 
10 
11 #include <boost/optional.hpp>
12 #include <queue>
13 
15 
16 namespace iroha::consensus::yac {
18  public:
19  using RoundType = Round;
20 
28  boost::optional<CleanupStrategy::RoundsType> finalize(
29  RoundType consensus_round, Answer answer) override;
30 
31  bool shouldCreateRound(const RoundType &round) override;
32 
33  private:
39  RoundsType truncateCreatedRounds();
40 
45  boost::optional<RoundType> minimalRound() const;
46 
51  void createRound(const Round &round);
52 
58  bool isRequiredCreation(const Round &round) const;
59 
61  std::priority_queue<RoundType,
62  std::vector<RoundType>,
63  std::greater<RoundType>>
64  created_rounds_;
65 
67  boost::optional<RoundType> last_reject_round_;
69  boost::optional<RoundType> last_commit_round_;
70  };
71 } // namespace iroha::consensus::yac
72 
73 #endif // IROHA_BUFFERED_CLEANUP_STRATEGY_HPP
Round RoundType
Definition: buffered_cleanup_strategy.hpp:19
Definition: cleanup_strategy.hpp:17
bool shouldCreateRound(const RoundType &round) override
Definition: buffered_cleanup_strategy.cpp:68
boost::optional< CleanupStrategy::RoundsType > finalize(RoundType consensus_round, Answer answer) override
Definition: buffered_cleanup_strategy.cpp:13
std::vector< Round > RoundsType
Definition: cleanup_strategy.hpp:22
Definition: buffered_cleanup_strategy.hpp:17
boost::variant< CommitMessage, RejectMessage, FutureMessage > Answer
Definition: storage_result.hpp:19
Definition: round.hpp:31
Definition: cluster_order.hpp:16