DEENESPTFRRUARHIKOZHNL

类 ara::diag::DiagnosticSovdArrayContentElementDataConstView

[SWS_DM_02248] Upstream: RS_Diag_04260

class DiagnosticSovdArrayContentElementDataConstView {...};

Const view on a DiagnosticSovdContentElementData with Array type.

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 · 温度: 不可控 · 提示词: 46670b91e1ad 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持对 SOVD 诊断数据对象的数组元素进行线程安全的只读访问。

类 ara::diag::DiagnosticSovdArrayContentElementDataConstView 提供了对数组类型的 DiagnosticSovdContentElementData 的只读视图,以进行高效的诊断查询 [SWS_DM_02248]。应用程序首先通过 HasError() 检查完整性状态,随后既可以通过 operator[] 随机访问,也可以通过 CBegin() 和 CEnd() 迭代访问数组元素 [SWS_DM_02253]。所有操作均以线程安全以及异常安全(noexcept)的方式实现,但前提是被引用的基础元素持续有效。

上下文

类 ara::diag::DiagnosticSovdArrayContentElementDataConstView 在针对 SOVD(Service-Oriented Vehicle Diagnostics)的 Adaptive AUTOSAR 诊断架构中提供了对数组类型诊断数据元素的只读视图(const view)[SWS_DM_02248](AUTOSAR_AP_SWS_Diagnostics §8.60.3 “Class: DiagnosticSovdArrayContentElementDataConstView”)。它允许对诊断内容的序列元素进行受控的读取访问,而无需复制底层数据缓冲区。

该类的主要交互对象包括:

  • 评估数组数据的调用端诊断应用程序,
  • 被引用的 DiagnosticSovdContentElementData,它存储具体数组元素,并在通过 [SWS_DM_02253] 进行随机访问时被引用,
  • 辅助类型 DiagnosticSovdArrayContentElementDataConstIterator,用于针对数组元素生成符合标准的迭代 [SWS_DM_02254]。
diag_kontext anwendung Diagnose-Anwendung view DiagnosticSovdArrayContentElementDataConstView anwendung->view liest element DiagnosticSovdContentElementData view->element referenziert const iterator DiagnosticSovdArrayContentElementDataConstIterator view->iterator erzeugt iterator->element traversiert

上下文图:View 在诊断应用程序、基础元素与迭代器之间的嵌入关系。来源:[SWS_DM_02248]、[SWS_DM_02253]、[SWS_DM_02254]。

生命周期

该类可通过头文件 #include "ara/diag/diagnostic_sovd_content_element_data.h" 获取 [SWS_DM_02248]。作为纯视图类,它不拥有实际数组数据的所有权。Interpretation:View 实例的生命周期与底层 DiagnosticSovdContentElementData 的有效性绑定;在 View 使用期间,数据对象必须保留在内存中。 问题 Q-1a3079bdd09b4ddd (未决)

在并发性方面,该类的所有成员函数均显式声明为线程安全 [SWS_DM_02250]、[SWS_DM_02253]。因此,多个线程可以同时以只读方式访问同一个 View 实例(Interpretation:前提是底层数据对象未被并发写操作修改)。 问题 Q-61e5fa3990052e70 (未决)此外,所有方法均保证完全的异常安全性(exception safe),且一律指定为 noexcept [SWS_DM_02249]、[SWS_DM_02251]。由于这是一个不可变视图,该类不存在内部状态迁移或复杂的生命周期阶段。

使用路径

使用数组数据的常规流程分为完整性检查、维度查询与数据提取:

  1. 完整性检查:在访问之前,应用程序应通过 HasError() 验证内容元素是否存在且无错误 [SWS_DM_02249]。
  2. 维度查询:可通过 Empty() 检查数组是否包含元素([SWS_DM_02252]、AUTOSAR_AP_SWS_Diagnostics §8.60.3.1.1.5 “Empty”)。Size() [SWS_DM_02250] 返回当前元素数量,而 Capacity() 返回数组的预留容量([SWS_DM_02251]、AUTOSAR_AP_SWS_Diagnostics §8.60.3.1.1.4 “Capacity”)。
  3. 数据访问:访问数组元素提供两种途径:
典型读取与迭代流程Diagnose-AnwendungDiagnosticSovdArrayContentElementDataConstViewHasError()ara::core::Result<void> (Erfolg)Size()std::size_t (Elementanzahl)altDirektzugriff per Indexoperator[](index)ara::core::Result<reference_wrapper<...>>Sequenzielle IterationCBegin()DiagnosticSovdArrayContentElementDataConstIteratorCEnd()DiagnosticSovdArrayContentElementDataConstIterator

时序图:用于错误检查、大小确定和元素查询的典型序列。来源:[SWS_DM_02249]、[SWS_DM_02250]、[SWS_DM_02253]、[SWS_DM_02256]、[SWS_DM_02257]。

错误场景

该类不使用 C++ 异常,而是通过 ara::core::Result 报告功能错误:

  • 错误的数据内容:若内容元素包含错误数据,HasError() 不会返回空的成功 Result,而是返回类型为 ara::diag::DiagSovdErrc 的错误码 [SWS_DM_02249]。
  • 索引访问时的类型冲突:operator[] 强制要求所引用的元素必须实际为 ArrayContentElementData 类型 [SWS_DM_02253]。若非如此,调用将失败,并在 Result 中返回相应的错误对象,而不是引用。
  • 索引边界:由于 operator[] 只能在有效范围内调用,调用方应预先通过 Size() [SWS_DM_02250] 或 Empty() [SWS_DM_02252] 确保所请求的索引存在。

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

成员图

类图

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

G nara__diag__DiagnosticSovdArrayContentElementDataConstView162 DiagnosticSovdArrayContentElementDataConstView + Begin() + CBegin() + CEnd() + Capacity() + Empty() + End() + HasError() + Size() + operator[]()

详细视图

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

方法

Begin 函数

Returns the begin operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto Begin () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;
Capacity 函数

Returns the capacity of the Array content element. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto Capacity () const noexcept -> std::size_t;
CBegin 函数

Returns the begin operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto CBegin () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;
CEnd 函数

Returns the end operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto CEnd () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;
Empty 函数

Returns if the Array is empty. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto Empty () const noexcept -> bool;
End 函数

Returns the end operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto End () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;
HasError 函数

Returns if the content contains an error.

auto HasError () const noexcept -> ara::core::Result< void >;
Size 函数

Returns the size of the Array content element. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto Size () const noexcept -> std::size_t;

运算符

operator[] 函数

Access the content element with specified index of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

auto operator[] (std::size_t index) const noexcept -> ara::core::Result< std::reference_wrapper< DiagnosticSovdContent ElementData const > >; DIRECTION NOT index -- DEFINED

方法文档

函数 Begin [SWS_DM_02254] Upstream: RS_Diag_04260

auto Begin () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;

Returns the begin operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
DiagnosticSovdArrayContentElementDataConstIteratorThe iterator

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

Record
AUTOSAR/AP/record/SWS_DM_02254
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02254@rel:R25-11#e4a65a0b
Content hash
e4a65a0b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02254
Status: valid/unmigrated Version: rel:R25-11#656898ea 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_02254@rel:R25-11#656898ea
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

函数 CBegin [SWS_DM_02256] Upstream: RS_Diag_04260

auto CBegin () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;

Returns the begin operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
DiagnosticSovdArrayContentElementDataConstIteratorThe iterator

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

Record
AUTOSAR/AP/record/SWS_DM_02256
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02256@rel:R25-11#1ee8f5c8
Content hash
1ee8f5c8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02256
Status: valid/unmigrated Version: rel:R25-11#b1016bc5 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_02256@rel:R25-11#b1016bc5
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

函数 CEnd [SWS_DM_02257] Upstream: RS_Diag_04260

auto CEnd () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;

Returns the end operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
DiagnosticSovdArrayContentElementDataConstIteratorThe iterator

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

Record
AUTOSAR/AP/record/SWS_DM_02257
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02257@rel:R25-11#e14adb32
Content hash
e14adb32
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02257
Status: valid/unmigrated Version: rel:R25-11#5c191314 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_02257@rel:R25-11#5c191314
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

函数 Capacity [SWS_DM_02251] Upstream: RS_Diag_04260

auto Capacity () const noexcept -> std::size_t;

Returns the capacity of the Array content element. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
std::size_tThe capacity of the ArrayContentElementData

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

Record
AUTOSAR/AP/record/SWS_DM_02251
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02251@rel:R25-11#418e41bd
Content hash
418e41bd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02251
Status: valid/unmigrated Version: rel:R25-11#dd87bdcc 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_02251@rel:R25-11#dd87bdcc
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

函数 Empty [SWS_DM_02252] Upstream: RS_Diag_04260

auto Empty () const noexcept -> bool;

Returns if the Array is empty. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
boolIf the array is empty

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

Record
AUTOSAR/AP/record/SWS_DM_02252
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02252@rel:R25-11#4f630ac0
Content hash
4f630ac0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02252
Status: valid/unmigrated Version: rel:R25-11#a85c7949 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_02252@rel:R25-11#a85c7949
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

函数 End [SWS_DM_02255] Upstream: RS_Diag_04260

auto End () noexcept -> DiagnosticSovdArrayContentElementDataConst Iterator;

Returns the end operator of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
DiagnosticSovdArrayContentElementDataConstIteratorThe iterator

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

Record
AUTOSAR/AP/record/SWS_DM_02255
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02255@rel:R25-11#6a3de1df
Content hash
6a3de1df
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02255
Status: valid/unmigrated Version: rel:R25-11#5d7352d1 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_02255@rel:R25-11#5d7352d1
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

函数 HasError [SWS_DM_02249] Upstream: RS_Diag_04260

auto HasError () const noexcept -> ara::core::Result< void >;

Returns if the content contains an error.

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

Rückgabewert

TypBeschreibung
ara::core::Result< void >void result if it doesn’t contain an error, otherwise the ara::diag::DiagSovdErrc

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

Record
AUTOSAR/AP/record/SWS_DM_02249
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02249@rel:R25-11#59b1075c
Content hash
59b1075c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02249
Status: valid/unmigrated Version: rel:R25-11#9d7e1ea6 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_02249@rel:R25-11#9d7e1ea6
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

函数 Size [SWS_DM_02250] Upstream: RS_Diag_04260

auto Size () const noexcept -> std::size_t;

Returns the size of the Array content element. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
std::size_tThe size of the ArrayContentElementData

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

Record
AUTOSAR/AP/record/SWS_DM_02250
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02250@rel:R25-11#0c89cb83
Content hash
0c89cb83
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02250
Status: valid/unmigrated Version: rel:R25-11#e76f7f29 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_02250@rel:R25-11#e76f7f29
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_02253] Upstream: RS_Diag_04260

auto operator[] (std::size_t index) const noexcept -> ara::core::Result< std::reference_wrapper< DiagnosticSovdContent ElementData const > >; DIRECTION NOT             index                       -- DEFINED

Access the content element with specified index of an array. This DiagnosticSovdContentElementData shall be of type ArrayContentElementData

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::reference_wrapper<DiagnosticSovdContentElementData const > >reference to the content element or an error if DiagnosticSovdContentElementData is not of type ArrayContentElementData

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

Record
AUTOSAR/AP/record/SWS_DM_02253
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02253@rel:R25-11#81a03ea4
Content hash
81a03ea4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02253
Status: valid/unmigrated Version: rel:R25-11#9a0c8a2c 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_02253@rel:R25-11#9a0c8a2c
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