CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
23 #include <boost/multiprecision/cpp_int.hpp>
26 namespace catapult {
namespace model {
45 explicit ChainScore(uint64_t scoreHigh, uint64_t scoreLow) {
60 static_cast<uint64_t>(
m_score & std::numeric_limits<uint64_t>::max())
std::array< uint64_t, 2 > ArrayType
Definition: ChainScore.h:32
ChainScore()
Creates a default chain score.
Definition: ChainScore.h:37
static constexpr uint32_t Bits_Per_Value
Definition: ChainScore.h:33
boost::multiprecision::uint128_t m_score
Definition: ChainScore.h:116
bool operator>(const ChainScore &rhs) const
Returns true if this score is greater than rhs.
Definition: ChainScore.h:99
ChainScore & operator-=(const ChainScore &rhs)
Subtracts rhs from this chain score.
Definition: ChainScore.h:72
ChainScore(uint64_t scoreHigh, uint64_t scoreLow)
Creates a chain score from a 128-bit value composed of two 64-bit values (scoreHigh and scoreLow).
Definition: ChainScore.h:45
bool operator<(const ChainScore &rhs) const
Returns true if this score is less than rhs.
Definition: ChainScore.h:89
ChainScore & operator=(const ChainScore &)=default
ChainScore & operator+=(const ChainScore &rhs)
Adds rhs to this chain score.
Definition: ChainScore.h:66
std::function< T()> supplier
A (stateless) supplier function.
Definition: functions.h:39
Definition: ChainScore.h:30
supplier< ChainScore > ChainScoreSupplier
Prototype for a function that returns a chain score.
Definition: ChainScore.h:120
bool operator==(const ChainScore &rhs) const
Returns true if this score is equal to rhs.
Definition: ChainScore.h:79
bool operator>=(const ChainScore &rhs) const
Returns true if this score is greater than or equal to rhs.
Definition: ChainScore.h:104
bool operator!=(const ChainScore &rhs) const
Returns true if this score is not equal to rhs.
Definition: ChainScore.h:84
Definition: AddressExtractionExtension.cpp:28
ChainScore(uint64_t score)
Creates a chain score from a 64-bit value (score).
Definition: ChainScore.h:41
friend std::ostream & operator<<(std::ostream &out, const ChainScore &score)
Insertion operator for outputting score to out.
Definition: ChainScore.h:110
bool operator<=(const ChainScore &rhs) const
Returns true if this score is less than or equal to rhs.
Definition: ChainScore.h:94
ArrayType toArray() const
Gets an array representing the underlying score.
Definition: ChainScore.h:57