DEENESPTFRRUARHIKOZHNL

类 ara::tsync::TsyncErrorDomain

[SWS_TS_00904] Upstream: RS_AP_00130, RS_AP_00122, RS_AP_00127, RS_AP_00154, RS_AP_00150

class TsyncErrorDomain final :               public ara::core::ErrorDomain {...};

Defines a class representing the Time Synchronization error domain.

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Forwarding-Header#include "ara/tsync/tsync_fwd.h"
Scopenamespace ara::tsync
Basisklasse(n)ara::core::ErrorDomain
Unique IDAs per ara::tsync::TsyncErrorDomain in [SWS_CORE_90023]

用户指南人工智能生成

封装时间同步的错误域,并将描述性文本和 C++ 异常与错误代码相对应。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0cbe92e308a4 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

封装时间同步的错误域,并将描述性文本和 C++ 异常与错误代码相对应。

错误域 ara::tsync::TsyncErrorDomain 将文本描述分配给时间同步的错误代码,并将其连接到平台的错误处理系统([SWS_TS_00906])。它提供了用于标识和消息查询的方法,并允许将错误转换为特定的 C++ 异常([SWS_TS_00908])。所有读取操作以及构造均以线程安全方式实现。如果在工具链中禁用了异常支持,则无法通过该域抛出异常。

上下文

类 ara::tsync::TsyncErrorDomain 定义了 AUTOSAR Adaptive Platform 中时间同步功能集群(Time Synchronization,tsync)的错误域。作为通用错误域 ara::core::ErrorDomain 的具体体现,它构成了平台级错误处理机制与模块的时间特定错误状态之间的桥梁。它将枚举 Errc([SWS_TS_01266])的错误代码进行一一映射,并为发生的同步问题提供文本及语义描述。通过成员函数 Name(),该类为域提供了一个固定的字符串标识符([SWS_TS_00906])。典型的交互伙伴包括生成错误的模块 tsync 的组件和接口、ara::core 的错误对象,以及必须查询时间信息并分析或转发错误状态的应用程​​序。

生命周期

该类的实例通过无参构造函数 TsyncErrorDomain() 进行初始化([SWS_TS_00905])。该构造函数被指定为异常安全(exception safe)和线程安全(thread-safe)([SWS_TS_00905])。解释:该对象在实践中应该作为长寿命的全局实例提供,因为 AUTOSAR Adaptive Platform 中的错误域在进程运行期内一直保持,并且不具有可变的状态数据。 问题 Q-1e9a43ce9dd340d2 (未决)在实例化之后,该对象不具有可变的生命周期阶段或内部状态转换。通过 Name()([SWS_TS_00906])和 Message()([SWS_TS_00907])进行的所有读取访问均被定义为异常安全和线程安全,因此该实例可以由多个线程并发且无需同步地进行查询。

使用路径

在正常运行流程中,一旦模块 tsync 的操作失败或需要对错误状态进行评估,该错误域就会发挥作用。错误主要通过类型别名 Errc 进行标识,该别名指向枚举 TsyncErrc([SWS_TS_01266])。为了进行诊断或记录日志,软件组件会使用相应的错误码调用函数 Message(),以获取作为指向字符串的常量指针形式的关联文本消息([SWS_TS_00907])。此外,还可以通过 Name() 获取该域的标识字符串([SWS_TS_00906])。

如果错误不作为值传递,而是要在传统异常处理框架下传播,则使用成员函数 ThrowAsException()([SWS_TS_00908])。该调用接收一个类型为 ara::core::ErrorCode 的对象,据此创建类型 TsyncException 的新实例——也可通过类内部别名 Exception 访问([SWS_TS_01267])——并将其作为 C++ 异常抛出([SWS_TS_00908])。下面的流程阐明了这一使用路径。

通过 ThrowAsException 抛出异常应用TsyncErrorDomainTsyncExceptionThrowAsException(errorCode)根据 errorCode 创建Instanz erzeugtthrow TsyncExceptionFehlerbehandlung (catch)

时序图:通过 ThrowAsException 触发异常的流程。来源:[SWS_TS_00908]、[SWS_TS_01267]。

错误场景

该域的错误范围通过枚举 Errc 表示([SWS_TS_01266])。错误码被传递给 Message(),该函数始终以异常安全且线程安全的方式返回关联的消息([SWS_TS_00907])。在使用 ThrowAsException() 时,根据定义,该函数被视为非异常安全的(not exception safe),因为它会中止正常控制流的执行并触发 C++ 异常([SWS_TS_00908])。

一个关键的边界条件涉及编译器和工具链配置:如果编译过程中禁用了 C++ 异常,根据平台规范,ThrowAsException() 将不参与重载解析([SWS_TS_00908])。因此,在没有异常支持的特定部署环境中,应用程序必须依赖基于结果对象的值返回机制,且不得调用异常生成功能。

本文由 AI 基于 AUTOSAR Adaptive R25-11 规范生成。

成员图

构造函数和析构函数

1

类型别名

2

类图

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

G nara__tsync__TsyncErrorDomain367 TsyncErrorDomain + TsyncErrorDomain() + Message() + Name() + ThrowAsException() nara__core__ErrorDomain335 ErrorDomain nara__tsync__TsyncErrorDomain367->nara__core__ErrorDomain335

详细视图

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

构造函数和析构函数

Constructs a new TsyncErrorDomain object.

TsyncErrorDomain () noexcept;

方法

Message 函数

Returns the message associated with errorCode.

const char * Message (CodeType errorCode) const noexcept override;
Name 函数

Returns a string constant associated with TsyncErrorDomain.

const char * Name () const noexcept override;

Creates a new instance of TsyncException from errorCode and throws it as a C++ exception. As per SWS_CORE_10304 this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.

void ThrowAsException (const ara::core::ErrorCode &errorCode) const noexcept(false) override;

类型别名

Errc 类型别名

Alias for the error code value enumeration

using Errc = TsyncErrc;
Exception 类型别名

Alias for the exception base class

方法文档

函数 Message [SWS_TS_00907] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

const char * Message (CodeType errorCode) const noexcept override;

Returns the message associated with errorCode.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 73e9c63939b3 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

类ara::tsync::TsyncErrorDomain的方法Message用于针对传入的错误代码同步获取文本错误描述[SWS_TS_00907]。它通过头文件#include "ara/tsync/tsync_error_domain.h"提供。作为输入参数,该函数接受类型为CodeType的errorCode,并返回指向相应消息的常量字符串指针(const char *)[SWS_TS_00907]。

错误处理与并发

该接口保证完全的异常安全性(exception safe),并声明为noexcept,因此可以确保调用在不产生 C++ 异常的情况下执行[SWS_TS_00907]。此外,该函数被指定为thread-safe,可以放心地从多个线程并发调用[SWS_TS_00907]。理解:返回的const char *可能指向不可变的静态内存,因此调用方无需手动释放内存。 问题 Q-933f88e4fde03016 (未决)

相互作用

作为重写的方法(override),该函数融入了 AUTOSAR Adaptive 的统一错误模型中[SWS_TS_00907]。类似地,来自头文件#include "apext/tsync/fvm_error_domain.h"的apext::tsync::TsyncFvmErrorDomain也实现了同名的Message函数,用于在相同的线程安全和异常安全性保证下解析特定于域的错误文本[SWS_TS_14210]。

本使用说明基于规范自动生成。

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error code number.

Rückgabewert

TypBeschreibung
const char *The message associated with the error code.

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

Record
AUTOSAR/AP/record/SWS_TS_00907
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_00907@rel:R25-11#6acd6034
Content hash
6acd6034
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_00907
Status: valid/unmigrated Version: rel:R25-11#16ac395e Versionshistorie & Revisions (1 transition, 4 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_00907@rel:R25-11#16ac395e
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#fb6984b62026-09-30
  • R23-11rel:R23-11#92c825fc2026-10-14
  • R24-11rel:R24-11#16ac395e2026-10-14
  • R25-11rel:R25-11#16ac395e2026-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

函数 Name [SWS_TS_00906] Upstream: RS_AP_00120, RS_AP_00130

const char * Name () const noexcept override;

Returns a string constant associated with TsyncErrorDomain.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 86c0a1bb7869 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

类ara::tsync::TsyncErrorDomain的成员函数Name()返回指向标识错误域的常量字符串的指针[SWS_TS_00906]。该函数需要头文件ara/tsync/tsync_error_domain.h,采用同步调用且不接受任何参数[SWS_TS_00906]。返回值为类型const char * [SWS_TS_00906]。理解:由于返回值定义为字符串常量,该内存区域可能具有静态生命周期,调用方既不得修改也不得释放它。 问题 Q-f9cb9d4986d49755 (未决)

错误处理与并发

该方法声明为noexcept,并被指定为具备异常安全性(“exception safe”),从而保证不会抛出异常[SWS_TS_00906]。对于此调用,不存在特定的错误代码、DET 或 DEM 消息。关于并发行为,该函数被归类为线程安全(“thread-safe”)[SWS_TS_00906]。因此,可以从多个执行上下文中并行进行调用,而无需外部同步。

协作与相关要求

通过标记override,该函数重写了模块ts中用于域命名的标准化接口[SWS_TS_00906]。相关的错误域apext::tsync::TsyncFvmErrorDomain实现了相同的设计模式,其来自apext/tsync/fvm_error_domain.h的函数Name()同样以同步、线程安全和异常安全的方式提供相应的标识符[SWS_TS_14209]。

本使用说明由 AI 生成。所有信息均完全基于 Release R25-11 的规范。

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
const char *As per ara::tsync::TsyncErrorDomain in [SWS_CORE_ 90023]

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

Record
AUTOSAR/AP/record/SWS_TS_00906
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_00906@rel:R25-11#579c0970
Content hash
579c0970
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_00906
Status: valid/unmigrated Version: rel:R25-11#a90a2e3e Versionshistorie & Revisions (1 transition, 4 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_00906@rel:R25-11#a90a2e3e
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#c1284f782026-09-30
  • R23-11rel:R23-11#54a3df7c2026-10-14
  • R24-11rel:R24-11#2c121e8a2026-10-14
  • R25-11rel:R25-11#a90a2e3e2026-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

函数 ThrowAsException [SWS_TS_00908] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

void ThrowAsException (const ara::core::ErrorCode &errorCode) const noexcept(false) override;

Creates a new instance of TsyncException from errorCode and throws it as a C++ exception. As per SWS_CORE_10304 this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 4179c9d54811 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

类ara::tsync::TsyncErrorDomain的成员函数ThrowAsException根据传入的参数errorCode同步创建TsyncException的新实例,并将其作为 C++ 异常([SWS_TS_00908])抛出。该函数没有返回值(void),并通过头文件ara/tsync/tsync_error_domain.h提供。

错误处理与异常安全性

该方法使用noexcept(false)声明,并被指定为 not exception safe([SWS_TS_00908])。理解:该分类的原因可能在于该函数按设计会触发异常,从而脱离常规控制流。 问题 Q-cde17219378516c1 (未决)不会返回特定的错误代码,而是通过抛出的异常对象进行传递。

并发性与限制

该函数被归类为 thread-safe([SWS_TS_00908]),因此可以安全地从并发线程中调用。一项重要限制涉及工具链:根据[SWS_CORE_10304],如果在编译器工具链中停用了 C++ 异常,则ThrowAsException不参与重载解析(overload resolution)。

相互作用

该行为符合 AUTOSAR Adaptive 中错误域的统一样式。在apext::tsync::TsyncFvmErrorDomain([SWS_TS_14211])中可以找到直接对应的功能,其中ThrowAsException抛出apext::tsync::TsyncFvmException,并且同样遵循来自[SWS_CORE_10304]的规定。

本使用说明基于 AUTOSAR Adaptive Release R25-11 规范。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error to throw.

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_TS_00908
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_00908@rel:R25-11#d93ae485
Content hash
d93ae485
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_00908
Status: valid/unmigrated Version: rel:R25-11#627a4cdd Versionshistorie & Revisions (1 transition, 4 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_00908@rel:R25-11#627a4cdd
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#b956a8742026-09-30
  • R23-11rel:R23-11#52fe73302026-10-14
  • R24-11rel:R24-11#627a4cdd2026-10-14
  • R25-11rel:R25-11#627a4cdd2026-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

函数 TsyncErrorDomain [SWS_TS_00905] Upstream: RS_AP_00120, RS_AP_00130

TsyncErrorDomain () noexcept;

Constructs a new TsyncErrorDomain object.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 2dee9c422a64 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

无参数的默认构造函数创建错误域 ara::tsync::TsyncErrorDomain 的新实例 [SWS_TS_00905]。该声明通过头文件 #include "ara/tsync/tsync_error_domain.h" 提供 [SWS_TS_00905]。执行为同步进行,不接收任何传入参数,且不抛出 C++ 异常(noexcept)[SWS_TS_00905]。

交互与错误处理

所创建的错误域用于封装和解释 Time Synchronization 模块中特定于同步的错误状态。在该域内,类型别名 Errc 用于错误代码枚举 TsyncErrc [SWS_TS_01266],而 Exception 用于异常基类 TsyncException [SWS_TS_01267]。该类的实例通过方法 Name 提供该域的常量名称字符串 [SWS_TS_00906],并通过 Message 提供指定错误代码的文本错误描述 [SWS_TS_00907]。此外,只要编译器启用了 C++ 异常,ThrowAsException 就允许基于 ara::core::ErrorCode 创建并抛出 TsyncException [SWS_TS_00908]。在典型应用场景中,极少需要通过构造函数进行自行实例化,因为通过 GetTsyncErrorDomain 已经提供了对全局实例对象的引用 [SWS_TS_00909]。 问题 Q-8ebaff4e52125b78 (未决)

并发性与限制

该调用被指定为异常安全(exception safe)和线程安全(thread-safe)[SWS_TS_00905]。因此,可以跨线程执行实例化,而无需额外的同步措施。

本使用说明基于规范自动生成。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

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

Record
AUTOSAR/AP/record/SWS_TS_00905
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_00905@rel:R25-11#cc49a9ff
Content hash
cc49a9ff
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_00905
Status: valid/unmigrated Version: rel:R25-11#db2535d3 Versionshistorie & Revisions (1 transition, 4 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_00905@rel:R25-11#db2535d3
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#fc141cdf2026-09-30
  • R23-11rel:R23-11#c63893f02026-10-14
  • R24-11rel:R24-11#db2535d32026-10-14
  • R25-11rel:R25-11#db2535d32026-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

类型别名文档

类型别名 Errc [SWS_TS_01266] Upstream: RS_AP_00120, RS_AP_00130

using Errc = TsyncErrc;

Alias for the error code value enumeration

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
SymbolErrc

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

Record
AUTOSAR/AP/record/SWS_TS_01266
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01266@rel:R25-11#d152f201
Content hash
d152f201
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01266
Status: valid/unmigrated Version: rel:R25-11#5f14392b Versionshistorie & Revisions (1 transition, 3 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_01266@rel:R25-11#5f14392b
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#079a906f2026-09-30
  • R24-11rel:R24-11#5f14392b2026-10-14
  • R25-11rel:R25-11#5f14392b2026-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

类型别名 Exception [SWS_TS_01267] Upstream: RS_AP_00120, RS_AP_00130

using Exception = TsyncException;

Alias for the exception base class

Header-Datei#include "ara/tsync/tsync_error_domain.h"
Scopeclass ara::tsync::TsyncErrorDomain
SymbolException

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

Record
AUTOSAR/AP/record/SWS_TS_01267
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_01267@rel:R25-11#f7e5b41d
Content hash
f7e5b41d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_01267
Status: valid/unmigrated Version: rel:R25-11#1b160d53 Versionshistorie & Revisions (1 transition, 3 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_01267@rel:R25-11#1b160d53
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#857684a62026-09-30
  • R24-11rel:R24-11#1b160d532026-10-14
  • R25-11rel:R25-11#1b160d532026-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