DEENESPTFRRUARHIKOZHNL

类 ara::diag::DiagnosticSovdArrayContentElementDataConstIterator

[SWS_DM_02221] Upstream: RS_Diag_04260

class DiagnosticSovdArrayContentElementDataConstIterator {...};

Const iterator for a DiagnosticSovdArrayContentElementData.

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

用户指南人工智能生成

支持在诊断应用程序中对 SOVD 数组元素进行只读、逐步遍历。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 7db6b86aff46 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持在诊断应用程序中对 SOVD 数组元素进行只读、逐步遍历。

类 ara::diag::DiagnosticSovdArrayContentElementDataConstIterator 为 SOVD 诊断上下文中的数组元素提供了只读前向迭代器([SWS_DM_02221])。应用程序使用它通过比较、解引用和自增运算符逐步遍历类型为 DiagnosticSovdContentElementData 的数据结构([SWS_DM_02222])。由于所有操作均被指定为 noexcept,因此检查迭代边界由调用方负责,以避免在无效位置出现未定义行为。

上下文

类 ara::diag::DiagnosticSovdArrayContentElementDataConstIterator 是 AUTOSAR Adaptive Platform 诊断模块(diag)的组成部分([SWS_DM_02221]、AUTOSAR_AP_SWS_Diagnostics §8.60.2 “Class: DiagnosticSovdArrayContentElementDataConstIterator”)。它满足面向服务的车辆诊断(SOVD,Service-Oriented Vehicle Diagnostics)的标准要求,并为顺序数据字段提供常量前向迭代器。其核心职责是封装对 DiagnosticSovdContentElementData 类型单个元素的只读访问([SWS_DM_02222]、[SWS_DM_02223])。作为交互伙伴出现的诊断应用程序通过头文件 ara/diag/diagnostic_sovd_content_element_data.h 解析符合 SOVD 规范的数组内容,而无法修改底层存储结构。

生命周期

类规范 [SWS_DM_02221] 未列出任何公共构造函数。因此,迭代器的实例化通常可能不是由应用软件本身执行,而是由上级数据对象的容器方法提供。 问题 Q-a2a94d90c92beb71 (未决)创建后,迭代器表示数组序列内的固定位置。

向下一个位置的转换通过前缀自增运算符 operator++ 进行,该运算符返回对已自增迭代器对象本身的引用([SWS_DM_02226])。关于并发性,该类的所有成员函数均明确指定为线程安全(thread-safe)([SWS_DM_02222] 至 [SWS_DM_02226])。因此,多个线程可以并发读取相同或不同的位置。如果通过 operator++ 修改并前移迭代器实例,则在共享使用时需要外部同步。所引用有效载荷数据的生命周期可能严格绑定到提供该数据的数据容器的生命周期。 问题 Q-743ef89528de7a75 (未决)

使用路径

典型使用路径符合针对集合的常量迭代器的经典 C++ 惯用法。在遍历开始时,调用方通过不等于运算符 operator!=([SWS_DM_02225])或等于运算符 operator==([SWS_DM_02224])与结束迭代器进行比较来检查当前位置的有效性。如果迭代器处于有效范围内,则应用程序以只读方式访问该元素:

  • 通过解引用运算符 operator*([SWS_DM_02222])返回常量引用 DiagnosticSovdContentElementData const&。
  • 通过箭头运算符 operator->([SWS_DM_02223])返回常量指针 DiagnosticSovdContentElementData const*,从而允许直接访问成员方法。

随后,调用方使用 operator++ 将迭代器向前推进一个位置([SWS_DM_02226]),并重复位置检查,直到达到结束状态。

只读数组迭代序列应用IteratorElementDataUse Case: 检查迭代边界operator!=(end)true(有效元素)Use Case: 只读数据访问operator*()Referenz ermittelnDiagnosticSovdContentElementData const&Use Case: Weiterschaltenoperator++()*this (inkrementierter Iterator)

时序图:逐步迭代 SOVD 数组元素的典型流程。来源:[SWS_DM_02222]、[SWS_DM_02225]、[SWS_DM_02226]

错误场景

该接口未定义任何以 ara::core::Result 形式出现的特殊错误代码或状态返回。所有操作均被指定为异常安全(exception safe)并带有说明符 noexcept([SWS_DM_02222] 至 [SWS_DM_02226])。在运行过程中不会引发 C++ 异常。

调用 operator* 和 operator-> 的基本前提条件是迭代器必须可解引用。由于缺少错误处理机制,解引用无效迭代器或结束迭代器可能导致未定义行为。 问题 Q-9144a319e654f27a (未决)同样,确保两个进行比较的迭代器来自同一序列也是调用方的责任。

本指南由 AI 模型根据 AUTOSAR 规范 R25-11 生成。

成员图

类图

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

G nara__diag__DiagnosticSovdArrayContentElementDataConstIterator518 DiagnosticSovdArrayContentElementDataConstIterator + operator!=() + operator*() + operator++() + operator->() + operator==()

详细视图

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

运算符

operator!= 函数

Not equal operator.

auto operator!= (DiagnosticSovdArrayContentElementDataConstIterator const &other) noexcept -> bool;
operator* 函数

Dereference operator.

auto operator* () noexcept -> DiagnosticSovdContentElementData const &;
operator++ 函数

Increment operator.

auto operator++ () noexcept -> DiagnosticSovdArrayContentElementData ConstIterator &;
operator-> 函数

Dereference operator.

auto operator-> () noexcept -> DiagnosticSovdContentElementData const *;
operator== 函数

Equal operator.

auto operator== (DiagnosticSovdArrayContentElementDataConstIterator const &other) noexcept -> bool;

方法文档

函数 operator!= [SWS_DM_02225] Upstream: RS_Diag_04260

auto operator!= (DiagnosticSovdArrayContentElementDataConstIterator const &other) noexcept -> bool;

Not equal operator.

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdArrayContentElementDataConstIterator
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
otherThe other iterator to test equality with

Rückgabewert

TypBeschreibung
boolTrue if operator are equals, false otherwise

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

Record
AUTOSAR/AP/record/SWS_DM_02225
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02225@rel:R25-11#f4d8c239
Content hash
f4d8c239
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02225
Status: valid/unmigrated Version: rel:R25-11#d81fc3aa Versionshistorie & Revisions (1 transition)
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_02225@rel:R25-11#d81fc3aa
Point-in-Time History:
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_02222] Upstream: RS_Diag_04260

auto operator* () noexcept -> DiagnosticSovdContentElementData const &;

Dereference operator.

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdArrayContentElementDataConstIterator
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
DiagnosticSovdContentReturn a reference to the DiagnosticSovdContentElementData ElementData const

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

Record
AUTOSAR/AP/record/SWS_DM_02222
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02222@rel:R25-11#f8299ddb
Content hash
f8299ddb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02222
Status: valid/unmigrated Version: rel:R25-11#6ba06c2c Versionshistorie & Revisions (1 transition)
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_02222@rel:R25-11#6ba06c2c
Point-in-Time History:
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_02226] Upstream: RS_Diag_04260

auto operator++ () noexcept -> DiagnosticSovdArrayContentElementData ConstIterator &;

Increment operator.

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdArrayContentElementDataConstIterator
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
DiagnosticSovdArrayContentElementDataConstIteratorReference to the incremented iterator

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

Record
AUTOSAR/AP/record/SWS_DM_02226
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02226@rel:R25-11#10739b67
Content hash
10739b67
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02226
Status: valid/unmigrated Version: rel:R25-11#da77b20e Versionshistorie & Revisions (1 transition)
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_02226@rel:R25-11#da77b20e
Point-in-Time History:
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_02223] Upstream: RS_Diag_04260

auto operator-> () noexcept -> DiagnosticSovdContentElementData const *;

Dereference operator.

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdArrayContentElementDataConstIterator
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
DiagnosticSovdContent Return a pointer to the DiagnosticSovdContentElementData ElementData const *

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

Record
AUTOSAR/AP/record/SWS_DM_02223
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02223@rel:R25-11#9877380e
Content hash
9877380e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02223
Status: valid/unmigrated Version: rel:R25-11#54f084a2 Versionshistorie & Revisions (1 transition)
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_02223@rel:R25-11#54f084a2
Point-in-Time History:
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_02224] Upstream: RS_Diag_04260

auto operator== (DiagnosticSovdArrayContentElementDataConstIterator const &other) noexcept -> bool;

Equal operator.

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdArrayContentElementDataConstIterator
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
otherThe other iterator to test equality with

Rückgabewert

TypBeschreibung
boolTrue if operator are equals, false otherwise

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

Record
AUTOSAR/AP/record/SWS_DM_02224
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02224@rel:R25-11#664bf5a0
Content hash
664bf5a0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02224
Status: valid/unmigrated Version: rel:R25-11#26232151 Versionshistorie & Revisions (1 transition)
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_02224@rel:R25-11#26232151
Point-in-Time History:
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