hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
round.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ROUND_HPP
7 #define IROHA_ROUND_HPP
8 
9 #include <cstddef>
10 #include <cstdint>
11 #include <string>
12 
13 #include <boost/operators.hpp>
14 
15 namespace iroha {
16  namespace consensus {
17 
21  using BlockRoundType = uint64_t;
22 
26  using RejectRoundType = uint32_t;
27 
31  struct Round : public boost::less_than_comparable<Round> {
34 
35  Round() = default;
36 
37  Round(BlockRoundType block_r, RejectRoundType reject_r);
38 
39  bool operator<(const Round &rhs) const;
40 
41  bool operator==(const Round &rhs) const;
42 
43  bool operator!=(const Round &rhs) const;
44 
45  std::string toString() const;
46  };
47 
48  std::size_t hash_value(Round const &val);
49 
50  } // namespace consensus
51 } // namespace iroha
52 
53 namespace std {
54  template <>
55  struct hash<iroha::consensus::Round> {
56  std::size_t operator()(iroha::consensus::Round const &val) const noexcept;
57  };
58 } // namespace std
59 
60 #endif // IROHA_ROUND_HPP
std::size_t hash_value(Round const &val)
Definition: round.cpp:42
Definition: round.cpp:51
bool operator==(const Round &rhs) const
Definition: round.cpp:25
Definition: block_query.hpp:15
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
uint32_t RejectRoundType
Definition: round.hpp:26
bool operator!=(const Round &rhs) const
Definition: round.cpp:30
BlockRoundType block_round
Definition: round.hpp:32
std::string toString() const
Definition: round.cpp:34
bool operator<(const Round &rhs) const
Definition: round.cpp:20
RejectRoundType reject_round
Definition: round.hpp:33
uint64_t BlockRoundType
Definition: round.hpp:21
Definition: round.hpp:31