CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace utils {
51 constexpr uint64_t
hours()
const {
56 constexpr uint64_t
days()
const {
63 if (
m_hours > std::numeric_limits<uint64_t>::max() / millisPerHour)
77 return !(*
this == rhs);
static constexpr BlockSpan FromDays(uint64_t days)
Creates a block span from the given number of days.
Definition: BlockSpan.h:45
utils::BaseValue< uint64_t, BlockDuration_tag > BlockDuration
Definition: src/catapult/types.h:88
constexpr bool operator!=(const BlockSpan &rhs) const
Returns true if this block span is not equal to rhs.
Definition: BlockSpan.h:76
uint64_t m_hours
Definition: BlockSpan.h:101
Represents a time duration.
Definition: TimeSpan.h:30
constexpr bool operator==(const BlockSpan &rhs) const
Returns true if this block span is equal to rhs.
Definition: BlockSpan.h:71
constexpr bool operator>=(const BlockSpan &rhs) const
Returns true if this block span is greater than or equal to rhs.
Definition: BlockSpan.h:81
Represents a block duration.
Definition: BlockSpan.h:28
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
static constexpr TimeSpan FromHours(uint64_t hours)
Creates a time span from the given number of hours.
Definition: TimeSpan.h:44
constexpr bool operator<(const BlockSpan &rhs) const
Returns true if this block span is less than rhs.
Definition: BlockSpan.h:96
constexpr BlockSpan()
Creates a default (zero) block span.
Definition: BlockSpan.h:35
std::ostream & operator<<(std::ostream &out, const BlockSpan &blockSpan)
Insertion operator for outputting blockSpan to out.
Definition: BlockSpan.cpp:27
constexpr uint64_t millis() const
Returns the number of milliseconds.
Definition: TimeSpan.h:91
static constexpr BlockSpan FromHours(uint64_t hours)
Creates a block span from the given number of hours.
Definition: BlockSpan.h:40
constexpr bool operator<=(const BlockSpan &rhs) const
Returns true if this block span is less than or equal to rhs.
Definition: BlockSpan.h:91
constexpr bool operator>(const BlockSpan &rhs) const
Returns true if this block span is greater than rhs.
Definition: BlockSpan.h:86
constexpr uint64_t hours() const
Returns the number of hours.
Definition: BlockSpan.h:51
Definition: AddressExtractionExtension.cpp:28
constexpr BlockSpan(uint64_t hours)
Definition: BlockSpan.h:30
constexpr uint64_t days() const
Returns the number of days.
Definition: BlockSpan.h:56
BlockDuration blocks(const TimeSpan &generationTargetTime) const
Returns the approximate number of blocks given the generation target time (generationTargetTime).
Definition: BlockSpan.h:61