CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::BlockSpan Class Referencefinal

Represents a block duration. More...

Public Member Functions

constexpr BlockSpan ()
 Creates a default (zero) block span. More...
 
constexpr uint64_t hours () const
 Returns the number of hours. More...
 
constexpr uint64_t days () const
 Returns the number of days. More...
 
BlockDuration blocks (const TimeSpan &generationTargetTime) const
 Returns the approximate number of blocks given the generation target time (generationTargetTime). More...
 
constexpr bool operator== (const BlockSpan &rhs) const
 Returns true if this block span is equal to rhs. More...
 
constexpr bool operator!= (const BlockSpan &rhs) const
 Returns true if this block span is not equal to rhs. More...
 
constexpr bool operator>= (const BlockSpan &rhs) const
 Returns true if this block span is greater than or equal to rhs. More...
 
constexpr bool operator> (const BlockSpan &rhs) const
 Returns true if this block span is greater than rhs. More...
 
constexpr bool operator<= (const BlockSpan &rhs) const
 Returns true if this block span is less than or equal to rhs. More...
 
constexpr bool operator< (const BlockSpan &rhs) const
 Returns true if this block span is less than rhs. More...
 

Static Public Member Functions

static constexpr BlockSpan FromHours (uint64_t hours)
 Creates a block span from the given number of hours. More...
 
static constexpr BlockSpan FromDays (uint64_t days)
 Creates a block span from the given number of days. More...
 

Private Member Functions

constexpr BlockSpan (uint64_t hours)
 

Private Attributes

uint64_t m_hours
 

Detailed Description

Represents a block duration.

Constructor & Destructor Documentation

◆ BlockSpan() [1/2]

constexpr catapult::utils::BlockSpan::BlockSpan ( uint64_t  hours)
inlineexplicitconstexprprivate

◆ BlockSpan() [2/2]

constexpr catapult::utils::BlockSpan::BlockSpan ( )
inlineconstexpr

Creates a default (zero) block span.

Here is the caller graph for this function:

Member Function Documentation

◆ blocks()

BlockDuration catapult::utils::BlockSpan::blocks ( const TimeSpan generationTargetTime) const
inline

Returns the approximate number of blocks given the generation target time (generationTargetTime).

Here is the call graph for this function:

◆ days()

constexpr uint64_t catapult::utils::BlockSpan::days ( ) const
inlineconstexpr

Returns the number of days.

Here is the caller graph for this function:

◆ FromDays()

static constexpr BlockSpan catapult::utils::BlockSpan::FromDays ( uint64_t  days)
inlinestaticconstexpr

Creates a block span from the given number of days.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromHours()

static constexpr BlockSpan catapult::utils::BlockSpan::FromHours ( uint64_t  hours)
inlinestaticconstexpr

Creates a block span from the given number of hours.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hours()

constexpr uint64_t catapult::utils::BlockSpan::hours ( ) const
inlineconstexpr

Returns the number of hours.

Here is the caller graph for this function:

◆ operator!=()

constexpr bool catapult::utils::BlockSpan::operator!= ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is not equal to rhs.

◆ operator<()

constexpr bool catapult::utils::BlockSpan::operator< ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is less than rhs.

◆ operator<=()

constexpr bool catapult::utils::BlockSpan::operator<= ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is less than or equal to rhs.

◆ operator==()

constexpr bool catapult::utils::BlockSpan::operator== ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is equal to rhs.

◆ operator>()

constexpr bool catapult::utils::BlockSpan::operator> ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is greater than rhs.

◆ operator>=()

constexpr bool catapult::utils::BlockSpan::operator>= ( const BlockSpan rhs) const
inlineconstexpr

Returns true if this block span is greater than or equal to rhs.

Member Data Documentation

◆ m_hours

uint64_t catapult::utils::BlockSpan::m_hours
private

The documentation for this class was generated from the following file: