|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <TimeIntervalList.hpp>
类 | |
| class | const_iterator |
Public 类型 | |
| using | iterator = const_iterator |
| using | value_type = TimeInterval |
| using | size_type = size_t |
| using | difference_type = std::ptrdiff_t |
Public 成员函数 | |
| TimeIntervalList ()=default | |
| ~TimeIntervalList ()=default | |
| TimeIntervalList (const TimeIntervalList &)=default | |
| TimeIntervalList & | operator= (const TimeIntervalList &)=default |
| TimeIntervalList (TimeIntervalList &&) noexcept=default | |
| TimeIntervalList & | operator= (TimeIntervalList &&) noexcept=default |
| TimeIntervalList (const TimePoint &epoch) | |
| size_t | size () const noexcept |
| bool | empty () const noexcept |
| void | reserve (size_t n) |
| void | clear () |
| AST_CORE_API TimeInterval | operator[] (size_t i) const |
| AST_CORE_API TimeInterval | at (size_t i) const |
| AST_CORE_API void | push_back (const TimeInterval &ti) |
| AST_CORE_API void | push_back (const TimePoint &start, const TimePoint &stop) |
| void | pop_back () |
| const TimePoint & | epoch () const noexcept |
| void | setEpoch (const TimePoint &epoch) |
| IntervalList & | intervals () noexcept |
| const IntervalList & | intervals () const noexcept |
| double | totalDuration () const |
| AST_CORE_API bool | contains (const TimePoint &t) const |
| AST_CORE_API TimeIntervalList | merged () const |
| AST_CORE_API void | mergeInPlace () |
| AST_CORE_API TimeIntervalList & | intersect (const TimeIntervalList &other) |
| AST_CORE_API TimeIntervalList & | unite (const TimeIntervalList &other) |
| AST_CORE_API TimeIntervalList & | subtract (const TimeIntervalList &other) |
| AST_CORE_API TimeIntervalList | intersected (const TimeIntervalList &other) const |
| AST_CORE_API bool | intersects (const TimeIntervalList &other) const |
| AST_CORE_API TimeIntervalList | united (const TimeIntervalList &other) const |
| AST_CORE_API TimeIntervalList | subtracted (const TimeIntervalList &other) const |
| TimeIntervalList & | operator&= (const TimeIntervalList &other) |
| TimeIntervalList & | operator|= (const TimeIntervalList &other) |
| TimeIntervalList & | operator-= (const TimeIntervalList &other) |
| TimeIntervalList | operator& (const TimeIntervalList &other) const |
| TimeIntervalList | operator| (const TimeIntervalList &other) const |
| TimeIntervalList | operator- (const TimeIntervalList &other) const |
| IntervalList | toIntervalList () const |
| TimeList | discretize (double step) const |
| TimeList | discretize (const TimePoint &epoch, double step) const |
| AST_CORE_API std::string | toString (int precision=kTimePointDefaultFormatPrecision) const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
静态 Public 成员函数 | |
| static AST_CORE_API TimeIntervalList | FromTimeInterval (const TimeInterval &interval) |
| static AST_CORE_API TimeIntervalList | FromTimeIntervals (const std::vector< TimeInterval > &intervals) |
| static AST_CORE_API TimeIntervalList | FromTimeIntervals (const std::vector< TimeInterval > &intervals, const TimePoint &epoch) |
| static AST_CORE_API TimeIntervalList | FromIntervals (const std::vector< Interval > &intervals, const TimePoint &epoch) |
| static AST_CORE_API TimeIntervalList | FromIntervalList (const IntervalList &list, const TimePoint &epoch) |
友元 | |
| const_iterator | operator+ (const_iterator::difference_type n, const const_iterator &it) |
绝对时段列表
绝对时段列表以 TimePoint 历元 + IntervalList 的形式存储一组绝对时间区间。
存储模型:
集合运算委托给 IntervalList,跨历元运算时自动将 other 转换到当前历元。
典型用途:
|
inline |
从参考历元构造空列表
| epoch | 参考历元 |
| TimeInterval ast::TimeIntervalList::at | ( | size_t | i | ) | const |
| bool ast::TimeIntervalList::contains | ( | const TimePoint & | t | ) | const |
检查绝对时间点是否落在任一区间内
| t | 绝对时间点 |
离散化(指定历元)
区间为闭区间 [start, stop],两端点均会被包含在输出中。 对每个区间按步长生成时间点序列,末端点始终被强制包含。 详见 IntervalList::discretize。
| epoch | 输出时间列表的参考历元 |
| step | 步长(秒,必须 > 0) |
|
inline |
离散化(使用当前 epoch)
区间为闭区间 [start, stop],两端点均会被包含在输出中。 对每个区间按步长生成时间点序列,末端点始终被强制包含。 详见 IntervalList::discretize。
| step | 步长(秒,必须 > 0) |
|
static |
|
static |
|
static |
从绝对区间向量构造
以第一个区间的 start 作为 epoch,所有区间转换为相对偏移。 若 intervals 为空,返回空列表(默认 epoch)。
| intervals | 绝对区间向量 |
|
static |
| TimeIntervalList & ast::TimeIntervalList::intersect | ( | const TimeIntervalList & | other | ) |
原地交集:将自身替换为「同时属于当前列表和 other 的时段」
| other | 另一个绝对时段列表 |
| TimeIntervalList ast::TimeIntervalList::intersected | ( | const TimeIntervalList & | other | ) | const |
交集(返回副本):同时属于当前列表和 other 的时段
| other | 另一个绝对时段列表 |
| bool ast::TimeIntervalList::intersects | ( | const TimeIntervalList & | other | ) | const |
判断两个绝对时段列表是否相交(存在正长度重叠区间)
| other | 另一个绝对时段列表 |
|
inlinenoexcept |
获取底层相对区间列表(可修改)
| TimeIntervalList ast::TimeIntervalList::merged | ( | ) | const |
| void ast::TimeIntervalList::mergeInPlace | ( | ) |
| TimeInterval ast::TimeIntervalList::operator[] | ( | size_t | i | ) | const |
|
inline |
移除最后一个区间
| void ast::TimeIntervalList::push_back | ( | const TimeInterval & | ti | ) |
追加一个绝对区间
| ti | 绝对时间区间 |
通过起止时间点追加绝对区间
| start | 开始时间点 |
| stop | 结束时间点 |
|
inline |
设置参考历元
| TimeIntervalList & ast::TimeIntervalList::subtract | ( | const TimeIntervalList & | other | ) |
原地差集:将自身替换为「属于当前列表但不属于 other 的时段」
| other | 另一个绝对时段列表 |
| TimeIntervalList ast::TimeIntervalList::subtracted | ( | const TimeIntervalList & | other | ) | const |
差集(返回副本):属于当前列表但不属于 other 的时段
| other | 另一个绝对时段列表 |
|
inline |
转换为相对区间列表
| std::string ast::TimeIntervalList::toString | ( | int | precision = kTimePointDefaultFormatPrecision | ) | const |
转换为字符串进行展示
| precision | 时间点格式化精度 |
| TimeIntervalList & ast::TimeIntervalList::unite | ( | const TimeIntervalList & | other | ) |
原地并集:将自身替换为「属于当前列表或 other 的时段」
| other | 另一个绝对时段列表 |
| TimeIntervalList ast::TimeIntervalList::united | ( | const TimeIntervalList & | other | ) | const |
并集(返回副本):属于当前列表或 other 的时段
| other | 另一个绝对时段列表 |