xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
xcal::property::TimePoint类 参考

时间点属性类 更多...

#include <time_point.hpp>

类 xcal::property::TimePoint 继承关系图:
[图例]
xcal::property::TimePoint 的协作图:
[图例]

Public 成员函数

 TimePoint ()
 默认构造函数
 
 TimePoint (const TimePoint &)=delete
 
 TimePoint (TimePoint &&)=delete
 
TimePointoperator= (const TimePoint &)=delete
 
TimePointoperator= (TimePoint &&)=delete
 
 TimePoint (float_t seconds_since_epoch)
 从浮点数秒构造函数
 
size_t microseconds_since_epoch () const
 获取从纪元开始的微秒数
 
float_t seconds_since_epoch () const
 获取从纪元开始的秒数
 
void set_microseconds_since_epoch (size_t us)
 设置从纪元开始的微秒数
 
void set_seconds_since_epoch (float_t seconds)
 设置从纪元开始的秒数
 
TimeDuration operator- (const TimePoint &other) const
 时间点减法运算(计算时间差)
 
bool operator== (const TimePoint &other) const
 时间点相等比较
 
bool operator!= (const TimePoint &other) const
 时间点不等比较
 
bool operator< (const TimePoint &other) const
 时间点小于比较
 
bool operator> (const TimePoint &other) const
 时间点大于比较
 
bool operator<= (const TimePoint &other) const
 时间点小于等于比较
 
bool operator>= (const TimePoint &other) const
 时间点大于等于比较
 
std::string to_string () const
 转换为字符串表示
 
std::string format (const std::string &) const
 格式化时间输出
 
- Public 成员函数 继承自 xcal::property::MProperty
 MProperty ()=default
 
 MProperty (const MProperty &)=delete
 
 MProperty (MProperty &&)=delete
 
MPropertyoperator= (const MProperty &)=delete
 
MPropertyoperator= (MProperty &&)=delete
 
bool_t is_changed () const
 
void set_changed () const
 
void reset_changed () const
 
Type type () const
 
virtual ~MProperty ()=default
 

详细描述

时间点属性类

表示特定的时间点,使用从纪元开始的微秒数存储。 支持从浮点数秒构造和时间运算。

在文件 time_point.hpp15 行定义.

构造及析构函数说明

◆ TimePoint() [1/4]

xcal::property::TimePoint::TimePoint ( )
inline

默认构造函数

注解
创建纪元时间点 (1970-01-01 00:00:00)

在文件 time_point.hpp25 行定义.

◆ TimePoint() [2/4]

xcal::property::TimePoint::TimePoint ( const TimePoint )
delete

◆ TimePoint() [3/4]

xcal::property::TimePoint::TimePoint ( TimePoint &&  )
delete

◆ TimePoint() [4/4]

xcal::property::TimePoint::TimePoint ( float_t  seconds_since_epoch)
inlineexplicit

从浮点数秒构造函数

参数
seconds_since_epoch从纪元开始的秒数(浮点数)

在文件 time_point.hpp35 行定义.

成员函数说明

◆ format()

std::string xcal::property::TimePoint::format ( const std::string &  ) const
inline

格式化时间输出

参数
format_pattern格式模式(TODO: 实现具体格式化逻辑)
返回
std::string 格式化后的时间字符串

在文件 time_point.hpp187 行定义.

引用了 xcal::to_string().

被这些函数引用 TEST().

◆ microseconds_since_epoch()

size_t xcal::property::TimePoint::microseconds_since_epoch ( ) const
inline

获取从纪元开始的微秒数

返回
size_t 微秒数

在文件 time_point.hpp59 行定义.

被这些函数引用 TEST(), TEST() , 以及 TEST().

◆ operator!=()

bool xcal::property::TimePoint::operator!= ( const TimePoint other) const
inline

时间点不等比较

参数
other另一个时间点
返回
bool 是否不等

在文件 time_point.hpp135 行定义.

◆ operator-()

TimeDuration xcal::property::TimePoint::operator- ( const TimePoint other) const
inline

时间点减法运算(计算时间差)

参数
other另一个时间点
返回
TimeDuration 两个时间点之间的时间段

在文件 time_point.hpp116 行定义.

◆ operator<()

bool xcal::property::TimePoint::operator< ( const TimePoint other) const
inline

时间点小于比较

参数
other另一个时间点
返回
bool 是否小于

在文件 time_point.hpp142 行定义.

◆ operator<=()

bool xcal::property::TimePoint::operator<= ( const TimePoint other) const
inline

时间点小于等于比较

参数
other另一个时间点
返回
bool 是否小于等于

在文件 time_point.hpp160 行定义.

◆ operator=() [1/2]

TimePoint & xcal::property::TimePoint::operator= ( const TimePoint )
delete

◆ operator=() [2/2]

TimePoint & xcal::property::TimePoint::operator= ( TimePoint &&  )
delete

◆ operator==()

bool xcal::property::TimePoint::operator== ( const TimePoint other) const
inline

时间点相等比较

参数
other另一个时间点
返回
bool 是否相等

在文件 time_point.hpp126 行定义.

◆ operator>()

bool xcal::property::TimePoint::operator> ( const TimePoint other) const
inline

时间点大于比较

参数
other另一个时间点
返回
bool 是否大于

在文件 time_point.hpp151 行定义.

◆ operator>=()

bool xcal::property::TimePoint::operator>= ( const TimePoint other) const
inline

时间点大于等于比较

参数
other另一个时间点
返回
bool 是否大于等于

在文件 time_point.hpp169 行定义.

◆ seconds_since_epoch()

float_t xcal::property::TimePoint::seconds_since_epoch ( ) const
inline

获取从纪元开始的秒数

返回
float_t 秒数(浮点数)

在文件 time_point.hpp67 行定义.

被这些函数引用 TEST(), TEST(), TEST() , 以及 TEST().

◆ set_microseconds_since_epoch()

void xcal::property::TimePoint::set_microseconds_since_epoch ( size_t  us)
inline

设置从纪元开始的微秒数

参数
us微秒数

在文件 time_point.hpp75 行定义.

被这些函数引用 TEST(), TEST(), TEST(), TEST(), TEST() , 以及 TEST().

◆ set_seconds_since_epoch()

void xcal::property::TimePoint::set_seconds_since_epoch ( float_t  seconds)
inline

设置从纪元开始的秒数

参数
seconds秒数(浮点数)

在文件 time_point.hpp83 行定义.

被这些函数引用 TEST().

◆ to_string()

std::string xcal::property::TimePoint::to_string ( ) const
inline

转换为字符串表示

返回
std::string 时间点的字符串表示

在文件 time_point.hpp177 行定义.

被这些函数引用 TEST().


该类的文档由以下文件生成: