DEENESPTFRRUARHIKOZHNL

结构体 ara::diag::EventStatusByte

[SWS_DM_00644] Upstream: RS_Diag_04151

struct EventStatusByte {...};

Current event status byte, bit-encoded.

Header-Datei#include "ara/diag/event_types.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopenamespace ara::diag

用户指南人工智能生成

表示诊断事件的按位编码状态字节,并提供用于状态位的类型安全检查方法。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c0a8a1df20de 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

表示诊断事件的按位编码状态字节,并提供用于状态位的类型安全检查方法。

结构体 ara::diag::EventStatusByte 封装了 Adaptive Platform 内单个诊断事件的按位编码状态字节 [SWS_DM_00644]。它提供了用于类型安全地查询已置位或未置位状态位以及复合检查状态的方法 [SWS_DM_01755]。由于计算始终反映具体事件,因此不受上级 DTC 事件组合的影响。作为轻量级的值对象,所有读访问均具有异常安全性并支持并发读取,而修改性赋值则必须进行外部同步。

上下文

结构体 ara::diag::EventStatusByte 封装了 AUTOSAR Adaptive Diagnostic Management 故障内存中诊断事件的按位编码状态字节 [SWS_DM_00644]。根据规范,EventStatusByte 始终精确表示关联单个事件的状态,并且在计算中不受可能存在的事件组合(Event Combination)的影响(AUTOSAR_AP_SWS_Diagnostics 第234页)。交互伙伴主要包括 Diagnostic Management Core(DM),它在事件状态更新时确定 UDS DTC 状态 [SWS_DM_01109] 并通过配置的回调进行通知 [SWS_DM_01110]。Interpretation:通过类型别名 ara::diag::EventStatusByteNotifier [SWS_DM_02118],此状态更改可能会通知已注册的应用程序函数,以便它们可以对状态更改做出反应。 问题 Q-8fd114acd74569ee (未决)

生命周期

ara::diag::EventStatusByte 的实例是头文件 ara/diag/event_types.h 中定义的轻量级值对象 [SWS_DM_01753]。创建通过复制、移动或接受任意数量待置位 EventStatusBits 的变参模板构造函数进行 [SWS_DM_01753]。由于构造函数和赋值运算符被声明为 constexpr 和 noexcept,因此对象可以在编译时构建(AUTOSAR_AP_SWS_Diagnostics §8.47.2.1.1 “Special Member Functions”)。

关于所有权和生命周期,该对象通常按值(by-value)或通过常量引用传递给通知程序。移动构造函数 [SWS_DM_01751] 和复制构造函数 [SWS_DM_01752] 保证异常和线程安全。相比之下,复制赋值运算符 [SWS_DM_01750] 以及移动赋值运算符 [SWS_DM_01749] 在规范中被明确归类为非线程安全(not thread-safe)。对现有状态字节的多次并发读访问是线程安全的,但对共享实例的修改性赋值需要外部同步。

使用路径

典型的用例是针对某些诊断标准检查由 Diagnostic Management 传输的状态字节。该类为此提供了专用的求值方法:

  • 检查故障测试:使用 IsFailedAndTested() 可以直接检查位 kTestFailed 和 kTestFailedThisOperationCycle 是否均已置位 [SWS_DM_01757]。Interpretation:这向应用程序发出信号,表明该事件在当前运行循环中已经过测试并评估为故障。 问题 (未决)
  • 检查无故障测试:只要既未置位 kTestFailed 也未置位 kTestNotCompletedThisOperationCycle,方法 IsPassedAndTested() 就会返回 true [SWS_DM_01756]。
  • 泛型位检查:通过模板 IsSet(bits...) 可以验证所有传入的状态位是否均已置位 [SWS_DM_01755]。作为补充,IsNotSet(bits...) 检查传入的位是否均未激活 [SWS_DM_01754]。

通过 clearDTC 操作重置故障时,无论是否配置了事件组合,Diagnostic Management 都会清除所有相关事件 [SWS_DM_01108]。以下时序图说明了状态更新及随后在应用程序中进行求值时的相互作用。

EventStatusByte 的通知与评估Diagnostic Management (DM)ara::diag::EventStatusByteNotifier应用Use Case: 事件和 DTC 状态更新计算 Event 状态和组合 DTC 状态使用 EventStatusByte 调用回调传输通知(statusByte)Use Case: 应用程序中的位检查statusByte.IsFailedAndTested()statusByte.IsSet(...)从通知返回Callback beendet

时序图:EventStatusByte 的典型通知和位掩码求值。来源:[SWS_DM_01109]、[SWS_DM_01110]、[SWS_DM_02118]、[SWS_DM_01757]、[SWS_DM_01755]

错误场景

由于 ara::diag::EventStatusByte 是一个基本数据容器,因此所有成员函数均被指定为 noexcept 且完全具备异常安全性([SWS_DM_01749] 至 [SWS_DM_01757])。既不抛出 C++ 异常,也不以 ara::core::Result 的形式返回错误代码。

因此,应用程序中的错误情况不是由 API 错误代码引起的,而是由语义误解或同步错误引起的。典型的风险包括在没有互斥锁保护的情况下通过赋值运算符进行并发写访问([SWS_DM_01749]、[SWS_DM_01750]),或者错误地假设 EventStatusByte 会被组合 DTC 修改,尽管根据规范它严格绑定到单个事件(AUTOSAR_AP_SWS_Diagnostics 第234页)。

本指南基于 AUTOSAR Adaptive R25-11 规范,并根据文档 AUTOSAR_AP_SWS_Diagnostics 总结了该类的属性。

成员图

类图

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

G nara__diag__EventStatusByte808 «struct» EventStatusByte + EventStatusByte() + operator=() + IsFailedAndTested() + IsNotSet() + IsPassedAndTested() + IsSet()

详细视图

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

构造函数和析构函数

Move constructor.

重载 EventStatusByte 3
constexpr EventStatusByte (EventStatusByte &&other) noexcept; SWS_DM_01751
constexpr EventStatusByte (const EventStatusByte &other) noexcept=default; SWS_DM_01752
template <typename... Args> constexpr EventStatusByte (Args... bits) noexcept; SWS_DM_01753

方法

Retrieve the value of the bits kTestFailed and kTestFailedThisOperationCycle.

constexpr bool IsFailedAndTested () const noexcept;
IsNotSet 函数

Whether all EventStatusBits passed as parameter are not set.

template <typename... Args> constexpr bool IsNotSet (Args... bits) const noexcept;

Retrieve the value of the bits kTestFailed and kTestNotCompletedThisOperationCycle.

constexpr bool IsPassedAndTested () const noexcept;
IsSet 函数

Whether all EventStatusBits passed as parameter are set.

template <typename... Args> constexpr bool IsSet (Args... bits) const noexcept;

运算符

operator= 函数 2

Move assignment operator.

重载 = 2
constexpr EventStatusByte & operator= (EventStatusByte &&other) noexcept; SWS_DM_01749
constexpr EventStatusByte & operator= (const EventStatusByte &other) noexcept; SWS_DM_01750

方法文档

函数 EventStatusByte [SWS_DM_01751] Upstream: RS_Diag_04151

constexpr EventStatusByte (EventStatusByte &&other) noexcept;

Move constructor.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
otherObject to move-construct from.

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

Record
AUTOSAR/AP/record/SWS_DM_01751
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01751@rel:R25-11#55fd6d07
Content hash
55fd6d07
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01751
Status: valid/unmigrated Version: rel:R25-11#9fd850aa 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_DM_01751@rel:R25-11#9fd850aa
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#80ee6eef2026-09-30
  • R23-11rel:R23-11#f03839ca2026-10-14
  • R24-11rel:R24-11#83bfcbc82026-10-14
  • R25-11rel:R25-11#9fd850aa2026-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

函数 EventStatusByte [SWS_DM_01752] Upstream: RS_Diag_04151

constexpr EventStatusByte (const EventStatusByte &other) noexcept=default;

Copy constructor.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherObject to copy-construct from.

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

Record
AUTOSAR/AP/record/SWS_DM_01752
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01752@rel:R25-11#89b7c768
Content hash
89b7c768
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01752
Status: valid/unmigrated Version: rel:R25-11#a5ed8b72 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_DM_01752@rel:R25-11#a5ed8b72
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#074496fc2026-09-30
  • R23-11rel:R23-11#cddbd9ff2026-10-14
  • R24-11rel:R24-11#03433e4b2026-10-14
  • R25-11rel:R25-11#a5ed8b722026-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

函数 EventStatusByte [SWS_DM_01753] Upstream: RS_Diag_04151

template <typename... Args> constexpr EventStatusByte (Args...              bits) noexcept;

Construct an EventStatusByte where all EventStatusBits passed as parameter are set.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
bitsThe EventStatusBits that shall be set.

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

Record
AUTOSAR/AP/record/SWS_DM_01753
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01753@rel:R25-11#d0d66156
Content hash
d0d66156
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01753
Status: valid/unmigrated Version: rel:R25-11#9c842ffa 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_DM_01753@rel:R25-11#9c842ffa
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#18617b5d2026-09-30
  • R23-11rel:R23-11#5403ab172026-10-14
  • R24-11rel:R24-11#c9fdf3532026-10-14
  • R25-11rel:R25-11#9c842ffa2026-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

函数 IsFailedAndTested [SWS_DM_01757] Upstream: RS_Diag_04151

constexpr bool IsFailedAndTested () const noexcept;

Retrieve the value of the bits kTestFailed and kTestFailedThisOperationCycle.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
boolTRUE: if bits kTestFailed AND kTestFailedThisOperationCycle are set, else FALSE

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

Record
AUTOSAR/AP/record/SWS_DM_01757
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01757@rel:R25-11#c8223461
Content hash
c8223461
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01757
Status: valid/unmigrated Version: rel:R25-11#b6349a53 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_DM_01757@rel:R25-11#b6349a53
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#3228b78e2026-09-30
  • R23-11rel:R23-11#c4166a272026-10-14
  • R24-11rel:R24-11#b3548d412026-10-14
  • R25-11rel:R25-11#b6349a532026-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

函数 IsNotSet [SWS_DM_01754] Upstream: RS_Diag_04151

template <typename... Args> constexpr bool IsNotSet (Args...            bits) const noexcept;

Whether all EventStatusBits passed as parameter are not set.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
bitsThe EventStatusBits to check.

Rückgabewert

TypBeschreibung
boolTRUE: if all EventStatusBits passed as parameter are NOT set, else FALSE.

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

Record
AUTOSAR/AP/record/SWS_DM_01754
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01754@rel:R25-11#ec924f25
Content hash
ec924f25
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01754
Status: valid/unmigrated Version: rel:R25-11#47d87a6e 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_DM_01754@rel:R25-11#47d87a6e
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#2bbf9bb92026-09-30
  • R23-11rel:R23-11#953465af2026-10-14
  • R24-11rel:R24-11#6ca8eb662026-10-14
  • R25-11rel:R25-11#47d87a6e2026-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

函数 IsPassedAndTested [SWS_DM_01756] Upstream: RS_Diag_04151

constexpr bool IsPassedAndTested () const noexcept;

Retrieve the value of the bits kTestFailed and kTestNotCompletedThisOperationCycle.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
boolTRUE: if bits kTestFailed AND kTestNotCompletedThisOperationCycle are NOT set, else FALSE

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

Record
AUTOSAR/AP/record/SWS_DM_01756
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01756@rel:R25-11#1f258d0f
Content hash
1f258d0f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01756
Status: valid/unmigrated Version: rel:R25-11#83d466e9 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_DM_01756@rel:R25-11#83d466e9
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#31cb55a72026-09-30
  • R23-11rel:R23-11#a372be6d2026-10-14
  • R24-11rel:R24-11#737a4c7c2026-10-14
  • R25-11rel:R25-11#83d466e92026-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

函数 IsSet [SWS_DM_01755] Upstream: RS_Diag_04151

template <typename... Args> constexpr bool IsSet (Args...            bits) const noexcept;

Whether all EventStatusBits passed as parameter are set.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
bitsThe EventStatusBits to check.

Rückgabewert

TypBeschreibung
boolTRUE: if all EventStatusBits passed as parameter are set, else FALSE.

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

Record
AUTOSAR/AP/record/SWS_DM_01755
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01755@rel:R25-11#e5da2252
Content hash
e5da2252
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01755
Status: valid/unmigrated Version: rel:R25-11#c9475089 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_DM_01755@rel:R25-11#c9475089
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#78b4f55e2026-09-30
  • R23-11rel:R23-11#1445ccf82026-10-14
  • R24-11rel:R24-11#b0fe50ac2026-10-14
  • R25-11rel:R25-11#c94750892026-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

函数 operator= [SWS_DM_01749] Upstream: RS_Diag_04151

constexpr EventStatusByte & operator= (EventStatusByte &&other) noexcept;

Move assignment operator.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
otherObject to move-assign from.

Rückgabewert

TypBeschreibung
EventStatusByte &EventStatusByte & Reference to self.

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

Record
AUTOSAR/AP/record/SWS_DM_01749
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01749@rel:R25-11#feec58be
Content hash
feec58be
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01749
Status: valid/unmigrated Version: rel:R25-11#69a39917 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_DM_01749@rel:R25-11#69a39917
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#8e539e8a2026-09-30
  • R23-11rel:R23-11#a8696e712026-10-14
  • R24-11rel:R24-11#bcd0e38b2026-10-14
  • R25-11rel:R25-11#69a399172026-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

函数 operator= [SWS_DM_01750] Upstream: RS_Diag_04151

constexpr EventStatusByte & operator= (const EventStatusByte &other) noexcept;

Copy assignment operator.

Header-Datei#include "ara/diag/event_types.h"
Scopestruct ara::diag::EventStatusByte
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
otherObject to copy-assign from.

Rückgabewert

TypBeschreibung
EventStatusByte &EventStatusByte & Reference to self.

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

Record
AUTOSAR/AP/record/SWS_DM_01750
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01750@rel:R25-11#a92aa944
Content hash
a92aa944
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01750
Status: valid/unmigrated Version: rel:R25-11#f85fa63e 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_DM_01750@rel:R25-11#f85fa63e
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#674831a92026-09-30
  • R23-11rel:R23-11#b7108fbb2026-10-14
  • R24-11rel:R24-11#de77ff602026-10-14
  • R25-11rel:R25-11#f85fa63e2026-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