Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::utils_t::TimeSpan Class Reference

Represents a span of time, providing utility functions for calculating days, hours, minutes, and seconds. More...

#include <ssgx_utils_t_time.h>

Public Member Functions

 TimeSpan () noexcept
 Default constructor, initializes the time span to 0.
 
 TimeSpan (time_t span) noexcept
 Constructs a TimeSpan from a given time span in seconds.
 
 TimeSpan (int64_t num_days, int num_hours, int num_mins, int num_secs) noexcept
 Constructs a TimeSpan from days, hours, minutes, and seconds.
 
time_t GetTimeSpan () const noexcept
 Returns the total time span in seconds.
 
int64_t GetDays () const noexcept
 Returns the number of days in the time span.
 
int64_t GetTotalHours () const noexcept
 Returns the total number of hours in the time span.
 
int64_t GetTotalMinutes () const noexcept
 Returns the total number of minutes in the time span.
 
int64_t GetTotalSeconds () const noexcept
 Returns the total number of seconds in the time span.
 
int64_t GetHours () const noexcept
 Returns the remaining hours after extracting days.
 
int64_t GetMinutes () const noexcept
 Returns the remaining minutes after extracting hours.
 
int64_t GetSeconds () const noexcept
 Returns the remaining seconds after extracting minutes.
 
TimeSpan operator+ (TimeSpan span) const noexcept
 
TimeSpan operator- (TimeSpan span) const noexcept
 
TimeSpanoperator+= (TimeSpan span) noexcept
 
TimeSpanoperator-= (TimeSpan span) noexcept
 
bool operator== (TimeSpan span) const noexcept
 
bool operator!= (TimeSpan span) const noexcept
 
bool operator< (TimeSpan span) const noexcept
 
bool operator> (TimeSpan span) const noexcept
 
bool operator<= (TimeSpan span) const noexcept
 
bool operator>= (TimeSpan span) const noexcept
 

Detailed Description

Represents a span of time, providing utility functions for calculating days, hours, minutes, and seconds.

Constructor & Destructor Documentation

◆ TimeSpan() [1/3]

ssgx::utils_t::TimeSpan::TimeSpan ( )
noexcept

Default constructor, initializes the time span to 0.

◆ TimeSpan() [2/3]

ssgx::utils_t::TimeSpan::TimeSpan ( time_t span)
explicitnoexcept

Constructs a TimeSpan from a given time span in seconds.

Parameters
spanTime span in seconds.

◆ TimeSpan() [3/3]

ssgx::utils_t::TimeSpan::TimeSpan ( int64_t num_days,
int num_hours,
int num_mins,
int num_secs )
noexcept

Constructs a TimeSpan from days, hours, minutes, and seconds.

Parameters
num_daysNumber of days.
num_hoursNumber of hours.
num_minsNumber of minutes.
num_secsNumber of seconds.

Member Function Documentation

◆ GetDays()

int64_t ssgx::utils_t::TimeSpan::GetDays ( ) const
nodiscardnoexcept

Returns the number of days in the time span.

Returns
Number of days.

◆ GetHours()

int64_t ssgx::utils_t::TimeSpan::GetHours ( ) const
nodiscardnoexcept

Returns the remaining hours after extracting days.

Returns
Number of hours.

◆ GetMinutes()

int64_t ssgx::utils_t::TimeSpan::GetMinutes ( ) const
nodiscardnoexcept

Returns the remaining minutes after extracting hours.

Returns
Number of minutes.

◆ GetSeconds()

int64_t ssgx::utils_t::TimeSpan::GetSeconds ( ) const
nodiscardnoexcept

Returns the remaining seconds after extracting minutes.

Returns
Number of seconds.

◆ GetTimeSpan()

time_t ssgx::utils_t::TimeSpan::GetTimeSpan ( ) const
nodiscardnoexcept

Returns the total time span in seconds.

Returns
Total time span in seconds.

◆ GetTotalHours()

int64_t ssgx::utils_t::TimeSpan::GetTotalHours ( ) const
nodiscardnoexcept

Returns the total number of hours in the time span.

Returns
Total number of hours.

◆ GetTotalMinutes()

int64_t ssgx::utils_t::TimeSpan::GetTotalMinutes ( ) const
nodiscardnoexcept

Returns the total number of minutes in the time span.

Returns
Total number of minutes.

◆ GetTotalSeconds()

int64_t ssgx::utils_t::TimeSpan::GetTotalSeconds ( ) const
nodiscardnoexcept

Returns the total number of seconds in the time span.

Returns
Total number of seconds.

◆ operator!=()

bool ssgx::utils_t::TimeSpan::operator!= ( TimeSpan span) const
noexcept

◆ operator+()

TimeSpan ssgx::utils_t::TimeSpan::operator+ ( TimeSpan span) const
noexcept

◆ operator+=()

TimeSpan & ssgx::utils_t::TimeSpan::operator+= ( TimeSpan span)
noexcept

◆ operator-()

TimeSpan ssgx::utils_t::TimeSpan::operator- ( TimeSpan span) const
noexcept

◆ operator-=()

TimeSpan & ssgx::utils_t::TimeSpan::operator-= ( TimeSpan span)
noexcept

◆ operator<()

bool ssgx::utils_t::TimeSpan::operator< ( TimeSpan span) const
noexcept

◆ operator<=()

bool ssgx::utils_t::TimeSpan::operator<= ( TimeSpan span) const
noexcept

◆ operator==()

bool ssgx::utils_t::TimeSpan::operator== ( TimeSpan span) const
noexcept

◆ operator>()

bool ssgx::utils_t::TimeSpan::operator> ( TimeSpan span) const
noexcept

◆ operator>=()

bool ssgx::utils_t::TimeSpan::operator>= ( TimeSpan span) const
noexcept

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