CatapultServer  v0.5.0.1 (Elephant)
BlockDifficultyInfo.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/types.h"
23 
24 namespace catapult { namespace state {
25 
29 
31  constexpr BlockDifficultyInfo()
33  {}
34 
36  constexpr explicit BlockDifficultyInfo(Height height)
37  : BlockDifficultyInfo(height, Timestamp(0), Difficulty(0))
38  {}
39 
41  constexpr explicit BlockDifficultyInfo(Height height, Timestamp timestamp, Difficulty difficulty)
42  : BlockHeight(height)
43  , BlockTimestamp(timestamp)
44  , BlockDifficulty(difficulty)
45  {}
46 
49 
52 
55 
57  constexpr bool operator<(const BlockDifficultyInfo& rhs) const {
58  return BlockHeight < rhs.BlockHeight;
59  }
60 
62  constexpr bool operator==(const BlockDifficultyInfo& rhs) const {
63  return BlockHeight == rhs.BlockHeight;
64  }
65 
67  constexpr bool operator!=(const BlockDifficultyInfo& rhs) const {
68  return BlockHeight != rhs.BlockHeight;
69  }
70  };
71 }}
catapult::state::BlockDifficultyInfo::BlockHeight
Height BlockHeight
Block height.
Definition: BlockDifficultyInfo.h:48
catapult::state::BlockDifficultyInfo::BlockTimestamp
Timestamp BlockTimestamp
Block timestamp.
Definition: BlockDifficultyInfo.h:51
catapult::state::BlockDifficultyInfo
Definition: BlockDifficultyInfo.h:28
catapult::utils::BaseValue< uint64_t, Height_tag >
catapult::state::BlockDifficultyInfo::BlockDifficultyInfo
constexpr BlockDifficultyInfo(Height height)
Creates a block difficulty info from a height.
Definition: BlockDifficultyInfo.h:36
catapult::state::BlockDifficultyInfo::BlockDifficultyInfo
constexpr BlockDifficultyInfo(Height height, Timestamp timestamp, Difficulty difficulty)
Creates a block difficulty info from a height, a timestamp and a difficulty.
Definition: BlockDifficultyInfo.h:41
catapult::state::BlockDifficultyInfo::operator!=
constexpr bool operator!=(const BlockDifficultyInfo &rhs) const
Returns true if this block difficulty info is not equal to rhs.
Definition: BlockDifficultyInfo.h:67
types.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::utils::ClampedBaseValue< uint64_t, Difficulty_tag >
catapult::state::BlockDifficultyInfo::BlockDifficulty
Difficulty BlockDifficulty
Block difficulty.
Definition: BlockDifficultyInfo.h:54
catapult::state::BlockDifficultyInfo::BlockDifficultyInfo
constexpr BlockDifficultyInfo()
Creates a default block difficulty info.
Definition: BlockDifficultyInfo.h:31
catapult::state::BlockDifficultyInfo::operator<
constexpr bool operator<(const BlockDifficultyInfo &rhs) const
Returns true if this block difficulty info is less than rhs.
Definition: BlockDifficultyInfo.h:57
catapult::state::BlockDifficultyInfo::operator==
constexpr bool operator==(const BlockDifficultyInfo &rhs) const
Returns true if this block difficulty info is equal to rhs.
Definition: BlockDifficultyInfo.h:62