|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
持续时间类型及其辅助函数 更多...
类 | |
| struct | is_duration< T > |
| 检查是否为持续时间类型 更多... | |
| class | duration< Rep, Period > |
| 持续时间类模板 更多... | |
类型定义 | |
| using | nanoseconds = duration<int64_t, nano> |
| 纳秒持续时间 | |
| using | microseconds = duration<int64_t, micro> |
| 微秒持续时间 | |
| using | milliseconds = duration<int64_t, milli> |
| 毫秒持续时间 | |
| using | seconds = duration<int64_t> |
| 秒持续时间 | |
| using | minutes = duration<int64_t, ratio<60>> |
| 分钟持续时间 | |
| using | hours = duration<int64_t, ratio<3600>> |
| 小时持续时间 | |
| using | days = duration<int64_t, ratio<86400>> |
| 天持续时间 | |
| using | weeks = duration<int64_t, ratio<604800>> |
| 周持续时间 | |
| using | years = duration<int64_t, ratio<31556952>> |
| 年持续时间(天文年) | |
| using | months = duration<int64_t, ratio<2629746>> |
| 月持续时间(平均月) | |
函数 | |
| template<typename ToDur, typename Rep, typename Period, enable_if_t< is_duration< ToDur >::value, int > = 0> | |
| constexpr ToDur | time_cast (const duration< Rep, Period > &value) |
| 持续时间类型转换 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | operator+ (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 加法运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | operator- (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 减法运算符 | |
| template<typename Rep1, typename Period, typename Rep2> | |
| constexpr duration< inner::__common_rep_t< Rep1, Rep2 >, Period > | operator* (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| 乘法运算符(持续时间 * 标量) | |
| template<typename Rep1, typename Rep2, typename Period> | |
| constexpr duration< inner::__common_rep_t< Rep2, Rep1 >, Period > | operator* (const Rep1 &scalar, const duration< Rep2, Period > &value) |
| 乘法运算符(标量 * 持续时间) | |
| template<typename Rep1, typename Period, typename Rep2> | |
| constexpr duration< inner::__common_rep_t< Rep1, enable_if_t<!is_duration_v< Rep2 >, Rep2 > >, Period > | operator/ (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| 除法运算符(持续时间 / 标量) | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr common_type_t< Rep1, Rep2 > | operator/ (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 除法运算符(持续时间 / 持续时间) | |
| template<typename Rep1, typename Period, typename Rep2> | |
| constexpr duration< inner::__common_rep_t< Rep1, enable_if_t<!is_duration_v< Rep2 >, Rep2 > >, Period > | operator% (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| 取模运算符(持续时间 % 标量) | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | operator% (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 取模运算符(持续时间 % 持续时间) | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator== (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 等于比较运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator!= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 不等于比较运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator< (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 小于比较运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator<= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 小于等于比较运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator> (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 大于比较运算符 | |
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> | |
| constexpr bool | operator>= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| 大于等于比较运算符 | |
| template<typename ToDur, typename Rep, typename Period> | |
| NEFORCE_NODISCARD constexpr enable_if_t< is_duration_v< ToDur >, ToDur > | floor (const duration< Rep, Period > &dur) |
| 向下取整持续时间转换 | |
| template<typename ToDur, typename Rep, typename Period> | |
| NEFORCE_NODISCARD constexpr enable_if_t< is_duration_v< ToDur >, ToDur > | ceil (const duration< Rep, Period > &dur) |
| 向上取整持续时间转换 | |
变量 | |
| template<typename T> | |
| NEFORCE_INLINE17 constexpr bool | is_duration_v = is_duration<T>::value |
| is_duration的便捷变量模板 | |
持续时间类型及其辅助函数
|
constexpr |
向上取整持续时间转换
| ToDur | 目标持续时间类型 |
| Rep | 源数值类型 |
| Period | 源时间单位比例 |
| dur | 源持续时间 |
在文件 duration.hpp 第 685 行定义.
引用了 time_cast().
|
constexpr |
向下取整持续时间转换
| ToDur | 目标持续时间类型 |
| Rep | 源数值类型 |
| Period | 源时间单位比例 |
| dur | 源持续时间 |
在文件 duration.hpp 第 668 行定义.
引用了 time_cast().
|
constexpr |
不等于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 591 行定义.
|
constexpr |
取模运算符(持续时间 % 标量)
| Rep1 | 数值类型 |
| Period | 时间单位比例 |
| Rep2 | 标量类型 |
| value | 持续时间 |
| scalar | 标量 |
在文件 duration.hpp 第 538 行定义.
引用了 count().
|
constexpr |
取模运算符(持续时间 % 持续时间)
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 555 行定义.
引用了 count().
|
constexpr |
乘法运算符(持续时间 * 标量)
| Rep1 | 数值类型 |
| Period | 时间单位比例 |
| Rep2 | 标量类型 |
| value | 持续时间 |
| scalar | 标量 |
在文件 duration.hpp 第 472 行定义.
引用了 count().
被这些函数引用 regex_iterator::operator->().
|
constexpr |
乘法运算符(标量 * 持续时间)
| Rep1 | 标量类型 |
| Rep2 | 数值类型 |
| Period | 时间单位比例 |
| scalar | 标量 |
| value | 持续时间 |
在文件 duration.hpp 第 488 行定义.
|
constexpr |
加法运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 436 行定义.
引用了 count().
|
constexpr |
减法运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 455 行定义.
引用了 count().
|
constexpr |
除法运算符(持续时间 / 标量)
| Rep1 | 数值类型 |
| Period | 时间单位比例 |
| Rep2 | 标量类型 |
| value | 持续时间 |
| scalar | 标量 |
在文件 duration.hpp 第 504 行定义.
引用了 count().
|
constexpr |
除法运算符(持续时间 / 持续时间)
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 520 行定义.
|
constexpr |
小于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 606 行定义.
|
constexpr |
小于等于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 624 行定义.
|
constexpr |
等于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 573 行定义.
|
constexpr |
大于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 639 行定义.
|
constexpr |
大于等于比较运算符
| Rep1 | 第一个数值类型 |
| Period1 | 第一个时间单位比例 |
| Rep2 | 第二个数值类型 |
| Period2 | 第二个时间单位比例 |
| lhs | 左操作数 |
| rhs | 右操作数 |
在文件 duration.hpp 第 654 行定义.
|
constexpr |
持续时间类型转换
| ToDur | 目标持续时间类型 |
| Rep | 源数值类型 |
| Period | 源时间单位比例 |
| value | 源持续时间 |
将一种持续时间类型转换为另一种,考虑时间单位的转换。
在文件 duration.hpp 第 144 行定义.
被这些函数引用 ceil(), duration< Rep, Period >::duration(), duration< common_type_t< Rep >, typename Period::type >::duration(), floor(), system_clock::from_seconds(), idb_connect::get_alive(), idb_connect::refresh_alive(), time_cast(), steady_clock::to_system() , 以及 semaphore::try_acquire_for().