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

Represents a time duration. More...

Public Member Functions

constexpr TimeSpan ()
 Creates a default (zero) time span. More...
 
constexpr uint64_t hours () const
 Returns the number of hours. More...
 
constexpr uint64_t minutes () const
 Returns the number of minutes. More...
 
constexpr uint64_t seconds () const
 Returns the number of seconds. More...
 
constexpr uint64_t millis () const
 Returns the number of milliseconds. More...
 
constexpr bool operator== (const TimeSpan &rhs) const
 Returns true if this time span is equal to rhs. More...
 
constexpr bool operator!= (const TimeSpan &rhs) const
 Returns true if this time span is not equal to rhs. More...
 
constexpr bool operator>= (const TimeSpan &rhs) const
 Returns true if this time span is greater than or equal to rhs. More...
 
constexpr bool operator> (const TimeSpan &rhs) const
 Returns true if this time span is greater than rhs. More...
 
constexpr bool operator<= (const TimeSpan &rhs) const
 Returns true if this time span is less than or equal to rhs. More...
 
constexpr bool operator< (const TimeSpan &rhs) const
 Returns true if this time span is less than rhs. More...
 

Static Public Member Functions

static constexpr TimeSpan FromHours (uint64_t hours)
 Creates a time span from the given number of hours. More...
 
static constexpr TimeSpan FromMinutes (uint64_t minutes)
 Creates a time span from the given number of minutes. More...
 
static constexpr TimeSpan FromSeconds (uint64_t seconds)
 Creates a time span from the given number of seconds. More...
 
static constexpr TimeSpan FromMilliseconds (uint64_t milliseconds)
 Creates a time span from the given number of milliseconds. More...
 
static constexpr TimeSpan FromDifference (Timestamp end, Timestamp start)
 Creates a time span from the difference between start and end. More...
 

Private Member Functions

template<typename TRep , typename TPeriod >
constexpr TimeSpan (const std::chrono::duration< TRep, TPeriod > &duration)
 

Static Private Member Functions

template<typename TDuration >
static constexpr uint64_t ConvertToDuration (const std::chrono::milliseconds &millis)
 

Private Attributes

std::chrono::milliseconds m_millis
 

Detailed Description

Represents a time duration.

Constructor & Destructor Documentation

◆ TimeSpan() [1/2]

template<typename TRep , typename TPeriod >
constexpr catapult::utils::TimeSpan::TimeSpan ( const std::chrono::duration< TRep, TPeriod > &  duration)
inlineexplicitconstexprprivate

◆ TimeSpan() [2/2]

constexpr catapult::utils::TimeSpan::TimeSpan ( )
inlineconstexpr

Creates a default (zero) time span.

Here is the caller graph for this function:

Member Function Documentation

◆ ConvertToDuration()

template<typename TDuration >
static constexpr uint64_t catapult::utils::TimeSpan::ConvertToDuration ( const std::chrono::milliseconds &  millis)
inlinestaticconstexprprivate
Here is the call graph for this function:

◆ FromDifference()

static constexpr TimeSpan catapult::utils::TimeSpan::FromDifference ( Timestamp  end,
Timestamp  start 
)
inlinestaticconstexpr

Creates a time span from the difference between start and end.

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

◆ FromHours()

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

Creates a time span from the given number of hours.

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

◆ FromMilliseconds()

static constexpr TimeSpan catapult::utils::TimeSpan::FromMilliseconds ( uint64_t  milliseconds)
inlinestaticconstexpr

Creates a time span from the given number of milliseconds.

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

◆ FromMinutes()

static constexpr TimeSpan catapult::utils::TimeSpan::FromMinutes ( uint64_t  minutes)
inlinestaticconstexpr

Creates a time span from the given number of minutes.

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

◆ FromSeconds()

static constexpr TimeSpan catapult::utils::TimeSpan::FromSeconds ( uint64_t  seconds)
inlinestaticconstexpr

Creates a time span from the given number of seconds.

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

◆ hours()

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

Returns the number of hours.

Here is the caller graph for this function:

◆ millis()

constexpr uint64_t catapult::utils::TimeSpan::millis ( ) const
inlineconstexpr

Returns the number of milliseconds.

Here is the caller graph for this function:

◆ minutes()

constexpr uint64_t catapult::utils::TimeSpan::minutes ( ) const
inlineconstexpr

Returns the number of minutes.

Here is the caller graph for this function:

◆ operator!=()

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

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

◆ operator<()

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

Returns true if this time span is less than rhs.

◆ operator<=()

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

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

◆ operator==()

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

Returns true if this time span is equal to rhs.

◆ operator>()

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

Returns true if this time span is greater than rhs.

◆ operator>=()

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

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

◆ seconds()

constexpr uint64_t catapult::utils::TimeSpan::seconds ( ) const
inlineconstexpr

Returns the number of seconds.

Here is the caller graph for this function:

Member Data Documentation

◆ m_millis

std::chrono::milliseconds catapult::utils::TimeSpan::m_millis
private

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