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

时间段属性类 更多...

#include <time_duration.hpp>

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

Public 成员函数

 TimeDuration ()
 默认构造函数
 
 TimeDuration (size_t microseconds)
 从微秒值构造函数
 
 TimeDuration (float_t seconds)
 从浮点数秒构造函数
 
size_t microseconds () const
 获取微秒值
 
size_t milliseconds () const
 获取毫秒值
 
float_t seconds () const
 获取秒数
 
float_t minutes () const
 获取分钟数
 
float_t hours () const
 获取小时数
 
void set_microseconds (size_t us)
 设置微秒值
 
void set_milliseconds (size_t ms)
 设置毫秒值
 
void set_seconds (float_t seconds)
 设置秒数
 
void set_minutes (float_t minutes)
 设置分钟数
 
void set_hours (float_t hours)
 设置小时数
 
TimeDuration operator+ (const TimeDuration &other) const
 时间段加法运算
 
TimeDuration operator- (const TimeDuration &other) const
 时间段减法运算
 
TimeDuration operator* (size_t multiplier) const
 时间段乘法运算
 
TimeDuration operator/ (size_t divisor) const
 时间段除法运算
 
bool operator== (const TimeDuration &other) const
 时间段相等比较
 
bool operator!= (const TimeDuration &other) const
 时间段不等比较
 
bool operator< (const TimeDuration &other) const
 时间段小于比较
 
bool operator> (const TimeDuration &other) const
 时间段大于比较
 
bool operator<= (const TimeDuration &other) const
 时间段小于等于比较
 
bool operator>= (const TimeDuration &other) const
 时间段大于等于比较
 
std::string to_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
 

静态 Public 成员函数

static TimeDuration from_microseconds (size_t us)
 从微秒创建时间段
 
static TimeDuration from_milliseconds (size_t ms)
 从毫秒创建时间段
 
static TimeDuration from_seconds (float_t seconds)
 从秒创建时间段
 
static TimeDuration from_minutes (float_t minutes)
 从分钟创建时间段
 
static TimeDuration from_hours (float_t hours)
 从小时创建时间段
 

详细描述

时间段属性类

表示时间间隔或持续时间,使用微秒精度存储。 支持从浮点数秒构造和各种时间单位转换。

在文件 time_duration.hpp13 行定义.

构造及析构函数说明

◆ TimeDuration() [1/3]

xcal::property::TimeDuration::TimeDuration ( )
inline

默认构造函数

注解
创建零时间段

在文件 time_duration.hpp23 行定义.

◆ TimeDuration() [2/3]

xcal::property::TimeDuration::TimeDuration ( size_t  microseconds)
inlineexplicit

从微秒值构造函数

参数
microseconds微秒值

在文件 time_duration.hpp29 行定义.

◆ TimeDuration() [3/3]

xcal::property::TimeDuration::TimeDuration ( float_t  seconds)
inlineexplicit

从浮点数秒构造函数

参数
seconds秒数(浮点数)

在文件 time_duration.hpp37 行定义.

成员函数说明

◆ from_hours()

static TimeDuration xcal::property::TimeDuration::from_hours ( float_t  hours)
inlinestatic

从小时创建时间段

参数
hours小时数(浮点数)
返回
TimeDuration 对应的时间段对象

在文件 time_duration.hpp82 行定义.

被这些函数引用 TEST().

◆ from_microseconds()

static TimeDuration xcal::property::TimeDuration::from_microseconds ( size_t  us)
inlinestatic

从微秒创建时间段

参数
us微秒值
返回
TimeDuration 对应的时间段对象

在文件 time_duration.hpp46 行定义.

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

◆ from_milliseconds()

static TimeDuration xcal::property::TimeDuration::from_milliseconds ( size_t  ms)
inlinestatic

从毫秒创建时间段

参数
ms毫秒值
返回
TimeDuration 对应的时间段对象

在文件 time_duration.hpp55 行定义.

被这些函数引用 TEST().

◆ from_minutes()

static TimeDuration xcal::property::TimeDuration::from_minutes ( float_t  minutes)
inlinestatic

从分钟创建时间段

参数
minutes分钟数(浮点数)
返回
TimeDuration 对应的时间段对象

在文件 time_duration.hpp73 行定义.

被这些函数引用 TEST().

◆ from_seconds()

static TimeDuration xcal::property::TimeDuration::from_seconds ( float_t  seconds)
inlinestatic

从秒创建时间段

参数
seconds秒数(浮点数)
返回
TimeDuration 对应的时间段对象

在文件 time_duration.hpp64 行定义.

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

◆ hours()

float_t xcal::property::TimeDuration::hours ( ) const
inline

获取小时数

返回
float_t 小时数(浮点数)

在文件 time_duration.hpp118 行定义.

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

◆ microseconds()

size_t xcal::property::TimeDuration::microseconds ( ) const
inline

获取微秒值

返回
size_t 微秒值

在文件 time_duration.hpp90 行定义.

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

◆ milliseconds()

size_t xcal::property::TimeDuration::milliseconds ( ) const
inline

获取毫秒值

返回
size_t 毫秒值

在文件 time_duration.hpp96 行定义.

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

◆ minutes()

float_t xcal::property::TimeDuration::minutes ( ) const
inline

获取分钟数

返回
float_t 分钟数(浮点数)

在文件 time_duration.hpp110 行定义.

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

◆ operator!=()

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

时间段不等比较

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

在文件 time_duration.hpp204 行定义.

◆ operator*()

TimeDuration xcal::property::TimeDuration::operator* ( size_t  multiplier) const
inline

时间段乘法运算

参数
multiplier乘数
返回
TimeDuration 相乘后的时间段

在文件 time_duration.hpp177 行定义.

◆ operator+()

TimeDuration xcal::property::TimeDuration::operator+ ( const TimeDuration other) const
inline

时间段加法运算

参数
other另一个时间段
返回
TimeDuration 相加后的时间段

在文件 time_duration.hpp159 行定义.

◆ operator-()

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

时间段减法运算

参数
other另一个时间段
返回
TimeDuration 相减后的时间段

在文件 time_duration.hpp168 行定义.

◆ operator/()

TimeDuration xcal::property::TimeDuration::operator/ ( size_t  divisor) const
inline

时间段除法运算

参数
divisor除数
返回
TimeDuration 相除后的时间段

在文件 time_duration.hpp186 行定义.

◆ operator<()

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

时间段小于比较

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

在文件 time_duration.hpp213 行定义.

◆ operator<=()

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

时间段小于等于比较

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

在文件 time_duration.hpp231 行定义.

◆ operator==()

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

时间段相等比较

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

在文件 time_duration.hpp195 行定义.

◆ operator>()

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

时间段大于比较

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

在文件 time_duration.hpp222 行定义.

◆ operator>=()

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

时间段大于等于比较

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

在文件 time_duration.hpp240 行定义.

◆ seconds()

float_t xcal::property::TimeDuration::seconds ( ) const
inline

获取秒数

返回
float_t 秒数(浮点数)

在文件 time_duration.hpp102 行定义.

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

◆ set_hours()

void xcal::property::TimeDuration::set_hours ( float_t  hours)
inline

设置小时数

参数
hours小时数(浮点数)

在文件 time_duration.hpp152 行定义.

被这些函数引用 TEST().

◆ set_microseconds()

void xcal::property::TimeDuration::set_microseconds ( size_t  us)
inline

设置微秒值

参数
us微秒值

在文件 time_duration.hpp126 行定义.

被这些函数引用 TEST().

◆ set_milliseconds()

void xcal::property::TimeDuration::set_milliseconds ( size_t  ms)
inline

设置毫秒值

参数
ms毫秒值

在文件 time_duration.hpp132 行定义.

被这些函数引用 TEST().

◆ set_minutes()

void xcal::property::TimeDuration::set_minutes ( float_t  minutes)
inline

设置分钟数

参数
minutes分钟数(浮点数)

在文件 time_duration.hpp146 行定义.

被这些函数引用 TEST().

◆ set_seconds()

void xcal::property::TimeDuration::set_seconds ( float_t  seconds)
inline

设置秒数

参数
seconds秒数(浮点数)

在文件 time_duration.hpp138 行定义.

被这些函数引用 TEST().

◆ to_string()

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

转换为字符串表示

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

在文件 time_duration.hpp248 行定义.

被这些函数引用 TEST().


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