DEENESPTFRRUARHIKOZHNL

结构体 ara::tsync::TimeBase

[SWS_TS_01260] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

struct TimeBase {...};

The class TimeBase is a pseudo-clock. The class TimeBase is a pseudo-clock that is used as the first template argument to std::chrono::time_point to indicate that the time point represents local time with respect of a not-yet-specified timeBaseResource.

Header-Datei#include "ara/tsync/timestamp.h"
Forwarding-Header#include "ara/tsync/tsync_fwd.h"
Scopenamespace ara::tsync

用户指南人工智能生成

用作 std::chrono::time_point 的伪时钟,用于映射 TimeBase 资源的本地时间点。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f515350f98f7 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用作 std::chrono::time_point 的伪时钟,用于映射 TimeBase 资源的本地时间点。

类 ara::tsync::TimeBase 在 C++ 标准库系统中充当伪时钟(Pseudo-Clock),并用作 std::chrono::time_point 的时钟模板参数,以表示相对于 TimeBase 资源的本地时间 [SWS_TS_01264]。为了满足时钟要求,它提供了用于纳秒分辨率和持续时间的标准化类型别名。作为决定性的约束条件,该时钟通过 is_steady = false 被指定为非单调的,从而考虑了同步过程引起的时间跳变 [SWS_TS_01265]。

上下文

类或结构体 ara::tsync::TimeBase 在 AUTOSAR Adaptive Platform 的模块 tsync 中承担伪时钟(Pseudo-Clock)的角色。它在 C++ 层面主要用作 std::chrono::time_point 的第一个模板参数,以便在语义上指定时间戳表示相对于尚未详细说明的 TimeBase 资源(timeBaseResource)的本地时间 [SWS_TS_01264]。TimeBase 本身并不作为具有静态时间查询功能的活动时间源,而是在标准库中充当形式上的纽带 std::chrono。

通过提供标准化的类型定义,TimeBase 将 C++ 时间测量的通用机制绑定到同步模块。处理时间点或持续时间的消费者和组件使用该结构体的别名类型来交换类型化时间戳。通过这种方式,可以确保时间值通过 std::chrono::time_point 明确分配给本地 TimeBase,而不会被错误地与绝对系统时钟或其他时间源混淆。

TimeBaseKontext time_point std::chrono::time_point<TimeBase> TimeBase ara::tsync::TimeBase (Pseudo-Clock) TimeBase->time_point dient als Typ-Argument timeBaseResource timeBaseResource (lokale Zeitbasis) timeBaseResource->TimeBase Referenz fuer lokale Zeit Anwendung Anwendungssoftware Anwendung->time_point 使用

上下文图:将 TimeBase 作为伪时钟嵌入到 C++ Chrono 类型系统中,以将时间点绑定到 TimeBase 资源。来源:[SWS_TS_01263]、[SWS_TS_01264]

生命周期

作为纯数据和类型结构(在头文件 ara/tsync/timestamp.h 中声明为 struct TimeBase),ara::tsync::TimeBase 不具备作为已初始化或正在运行的运行时组件意义上的动态生命周期阶段。实例化该结构的受保护对象对于预定功能并不是强制必需的;它主要在编译时存在于 C++ 类型系统层级。

为了满足 C++ 时钟要求(C++ Clock Requirements)的形式要求,TimeBase 定义了所有必需的类型别名和常量。这包括用于表示时间刻度数 [SWS_TS_01261] 的作为 std::int64_t 的基本计数器类型 rep,以及作为 std::nano [SWS_TS_01262] 的时间刻度间隔 period,这对应于纳秒范围内的分辨率。用于测量自纪元以来时间的持续时间通过类型别名 duration 作为 std::chrono::duration<rep, period> 提供 [SWS_TS_01263]。

关于并发性以及在运行系统中的行为,该结构体声明了布尔值为 false [SWS_TS_01265] 的静态常量 is_steady。这向 C++ Chrono 框架表明底层时钟不是单调的(steady)。解释:这可能是因为模块 tsync 中的时间同步过程可能会导致本地 TimeBase 发生调整或跳变,因此连续测量不能保证严格的单调性。 问题 Q-93a56c0eb2d35c7b (未决)由于该结构体本身不封装可变状态,因此所有类型的使用和常量的访问在本质上都是并发安全的。

使用路径

ara::tsync::TimeBase 的典型使用路径在于同步应用程序中时间值的声明、处理和传递。开发人员和自适应软件组件不会实例化时钟本身,而是访问定义为 std::chrono::time_point<TimeBase> 的核心类型别名 time_point [SWS_TS_01264]。

  • 类型定义与接口规范:应用程序包含头文件 ara/tsync/timestamp.h 并使用 ara::tsync::TimeBase::time_point [SWS_TS_01264] 来声明时间戳的签名。解释:由此确保时间点在语义上保持与特定的本地 TimeBase 耦合。 问题 Q-549e2d377c0a6845 (未决)
  • 算术与差值计算:若两个时间点相减,表达式会自动产生类型 ara::tsync::TimeBase::duration [SWS_TS_01263]。该类型基于纳秒步长(period)[SWS_TS_01262] 和 64 位整数(rep)[SWS_TS_01261],从而允许进行符合标准的持续时间计算以及转换为其他时间单位。
  • 与标准算法的互操作性:通过完全满足时钟类型要求,时间点和时间段可以无缝传递给 std::chrono 的标准库函数,而无需使用专有的时间结构。

解释:由于 TimeBase 被设计为伪时钟,它本身不提供静态成员函数 now();此类 time_point [SWS_TS_01264] 的具体时间值确定可能由模块 tsync 中连接到所引用的 timeBaseResource 的其他服务或接口完成。 问题 Q-2a528a99023dad41 (未决)

本指南基于 AUTOSAR Adaptive Platform R25-11 规范。

成员图

类图

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__tsync__TimeBase940 «struct» TimeBase + is_steady

详细视图

请在大纲中选择一个条目。

类型别名

duration 类型别名

required type declaration to fulfill the C++ Clock requirements used to measure the time since epoch

using duration = std::chrono::duration<rep, period>;
period 类型别名

required type declaration to fulfill the C++ Clock requirements representing the tick period of the duration

using period = std::nano;
rep 类型别名

required type declaration to fulfill the C++ Clock requirements representing the number of ticks

using rep = std::int64_t;
time_point 类型别名

represents a point in time

using time_point = std::chrono::time_point<TimeBase>;

常量

is_steady 变量

required constant to fulfill the C++ Clock requirements as steady clock

static constexpr bool is_steady = false;

类型别名文档

类型别名 duration [SWS_TS_01263] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

using duration = std::chrono::duration<rep, period>;

required type declaration to fulfill the C++ Clock requirements used to measure the time since epoch

Header-Datei#include "ara/tsync/timestamp.h"
Scopestruct ara::tsync::TimeBase
Symbolduration

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_TS_01263
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01263@rel:R25-11#2f9ed393
Content hash
2f9ed393
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01263
Status: valid/unmigrated Version: rel:R25-11#5cf6241f Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_TS_01263@rel:R25-11#5cf6241f
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#77b32a122026-09-30
  • R21-11rel:R21-11#aef3c9f02026-10-14
  • R22-11rel:R22-11#279628e32026-10-14
  • R23-11rel:R23-11#7904d5812026-10-14
  • R24-11rel:R24-11#5cf6241f2026-10-14
  • R25-11rel:R25-11#5cf6241f2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

类型别名 period [SWS_TS_01262] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

using period = std::nano;

required type declaration to fulfill the C++ Clock requirements representing the tick period of the duration

Header-Datei#include "ara/tsync/timestamp.h"
Scopestruct ara::tsync::TimeBase
Symbolperiod

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_TS_01262
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01262@rel:R25-11#1abea61d
Content hash
1abea61d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01262
Status: valid/unmigrated Version: rel:R25-11#d2f30081 Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_TS_01262@rel:R25-11#d2f30081
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#80c2628e2026-09-30
  • R21-11rel:R21-11#f7e53bcc2026-10-14
  • R22-11rel:R22-11#4294ebea2026-10-14
  • R23-11rel:R23-11#b0d1dd9c2026-10-14
  • R24-11rel:R24-11#d2f300812026-10-14
  • R25-11rel:R25-11#d2f300812026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

类型别名 rep [SWS_TS_01261] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

using rep = std::int64_t;

required type declaration to fulfill the C++ Clock requirements representing the number of ticks

Header-Datei#include "ara/tsync/timestamp.h"
Scopestruct ara::tsync::TimeBase
Symbolrep

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_TS_01261
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01261@rel:R25-11#a73ced03
Content hash
a73ced03
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01261
Status: valid/unmigrated Version: rel:R25-11#e1fffc65 Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_TS_01261@rel:R25-11#e1fffc65
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#7b8ecc442026-09-30
  • R21-11rel:R21-11#354e4b092026-10-14
  • R22-11rel:R22-11#4f8ca1772026-10-14
  • R23-11rel:R23-11#ffbe9b8d2026-10-14
  • R24-11rel:R24-11#e1fffc652026-10-14
  • R25-11rel:R25-11#e1fffc652026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

类型别名 time_point [SWS_TS_01264] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

using time_point = std::chrono::time_point<TimeBase>;

represents a point in time

Header-Datei#include "ara/tsync/timestamp.h"
Scopestruct ara::tsync::TimeBase
Symboltime_point

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_TS_01264
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01264@rel:R25-11#19fd5fa3
Content hash
19fd5fa3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01264
Status: valid/unmigrated Version: rel:R25-11#611cfa6a Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_TS_01264@rel:R25-11#611cfa6a
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#bb2caf412026-09-30
  • R21-11rel:R21-11#f0181e5d2026-10-14
  • R22-11rel:R22-11#1f9672ca2026-10-14
  • R23-11rel:R23-11#611cfa6a2026-10-14
  • R24-11rel:R24-11#611cfa6a2026-10-14
  • R25-11rel:R25-11#611cfa6a2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

常量 / 变量文档

变量 is_steady [SWS_TS_01265] Upstream: RS_AP_00130, RS_TS_00005 原文尚未导入

static constexpr bool is_steady = false;

required constant to fulfill the C++ Clock requirements as steady clock

Header-Datei#include "ara/tsync/timestamp.h"
Scopestruct ara::tsync::TimeBase
Symbolis_steady
Typbool

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_TS_01265
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01265@rel:R25-11#ffe466e1
Content hash
ffe466e1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01265
Status: valid/unmigrated Version: rel:R25-11#edb698f5 Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_TS_01265@rel:R25-11#edb698f5
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#bb6214b32026-09-30
  • R21-11rel:R21-11#0d0dd4892026-10-14
  • R22-11rel:R22-11#c6a540902026-10-14
  • R23-11rel:R23-11#6b5858822026-10-14
  • R24-11rel:R24-11#edb698f52026-10-14
  • R25-11rel:R25-11#edb698f52026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill