DEENESPTFRRUARHIKOZHNL

类 ara::diag::DiagnosticSovdContentElementDataWithKey

[SWS_DM_02375] Upstream: RS_Diag_04260

class DiagnosticSovdContentElementDataWithKey {...};

A DiagnosticSovdContentElementData with associated key.

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

封装 SOVD 诊断内容元素以及用于读写操作的键标识符。

该类用于封装 SOVD 诊断内容元素以及唯一键标识符 [SWS_DM_02375]。它在符合 ASAM SOVD 的写访问时由 Diagnostic Management 填充,并转发至 GenericDiagnosticSovdContent::Write [SWS_DM_02166]。所有成员函数均指定为线程安全且异常安全,其中错误的赋值通过 ara::core::Result 并带有 DiagErrc::kInvalidArgument 报告 [SWS_DM_02381]。

上下文

在 Adaptive Platform 中,类 ara::diag::DiagnosticSovdContentElementDataWithKey 用作 ASAM SOVD(Service-Oriented Vehicle Diagnostics)上下文中单个诊断内容元素的数据封装,并为有效负载对象分配唯一键标识符 [SWS_DM_02375]。SOVD 数据通过模型元素 DiagnosticSovdContent 进行结构化,该元素由至少一个 DiagnosticSovdContentElement 组成 AUTOSAR_AP_SWS_Diagnostics §7.3.3.3.2 “SOVD Data – Conversion”。虽然读取查询通过 GenericDiagnosticSovdContent::Read 处理 [SWS_DM_01432],但该类主要与 Diagnostic Management (DM) 以及服务接口 GenericDiagnosticSovdContent::Write 交互,以对数据资源执行结构化写访问 [SWS_DM_01431]、[SWS_DM_02166]。

生命周期

ara::diag::DiagnosticSovdContentElementDataWithKey 的实例化与销毁遵循 RAII 原则。析构函数以及相关的复制和移动操作(移动/复制构造函数和赋值运算符)显式声明为 noexcept [SWS_DM_02376]。关于所有权关系,该类在 SetContent [SWS_DM_02381] 中通过按值传递接管有效负载内容,而键名则作为 ara::core::StringView 传递 [SWS_DM_02378]。Diagnostic Management 应该在内部确保底层字符串在访问期间保持有效或被复制到内部存储中。 问题 Q-f00f62f43629a773 (未决)根据规范,该类的所有成员函数均设计为线程安全且异常安全 [SWS_DM_02376]、[SWS_DM_02377]、[SWS_DM_02378]、[SWS_DM_02379]、[SWS_DM_02380]、[SWS_DM_02381]。

使用路径

典型的使用路径出现在接收到针对实体数据资源的 SOVD 写请求时 [SWS_DM_01431]。Diagnostic Management 创建或使用一个实例,首先通过 SetName 设置各个 DiagnosticSovdContentElement [SWS_DM_02166]、[SWS_DM_02378] 的 shortName。随后根据转换规则转换传入的值 AUTOSAR_AP_SWS_Diagnostics §7.3.3.3.2 “SOVD Data – Conversion” 并通过 SetContent 进行赋值 [SWS_DM_02166]、[SWS_DM_02381]。以此方式聚合的数据随后被转发给 GenericDiagnosticSovdContent::Write [SWS_DM_02166]。使用方可通过 GetName 查询键名 [SWS_DM_02377],并通过 GetContent 的常量或非常量重载检查或操作数据内容 [SWS_DM_02379]、[SWS_DM_02380]。

通过 DiagnosticSovdContentElementDataWithKey 写入 SOVD 数据的流程SOVD-Client诊断管理DiagnosticSovdContentElementDataWithKeyGenericDiagnosticSovdContentSOVD Write a data resourceSetName(shortName)SetContent(content)ara::core::Result<void>Write(DiagnosticSovdContentData)GetName() / GetContent()键名与数据引用SchreibstatusSOVD-Antwort

时序图:使用 DiagnosticSovdContentElementDataWithKey 处理 SOVD 写请求时的调用流和数据流。来源:[SWS_DM_01431]、[SWS_DM_02166]、[SWS_DM_02378]、[SWS_DM_02381]。

错误场景

在发生错误时,该类不使用 C++ 异常,而是通过 SetContent [SWS_DM_02381] 的返回类型 ara::core::Result<void> 报告失败。如果设置内容失败(例如,传入的内容类型与目标结构不匹配或无效),则返回错误码 DiagErrc::kInvalidArgument [SWS_DM_02381]。调用方在将对象传递给 GenericDiagnosticSovdContent::Write 之前必须检查返回的结果 [SWS_DM_02166]。

本类指南基于 AUTOSAR AP Release R25-11 规范。所有陈述均由接口 ara::diag 的 SWS 需求和文档出处证实。

成员图

类图

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

G nara__diag__DiagnosticSovdContentElementDataWithKey42 DiagnosticSovdContentElementDataWithKey + ~DiagnosticSovdContentElementDataWithKey() + GetContent() + GetName() + SetContent() + SetName()

详细视图

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

构造函数和析构函数

Declare the Dtor and move/copy constructors/assignments .

方法

GetContent 函数 2

Gets the associated content.

重载 GetContent 2
auto GetContent () noexcept -> DiagnosticSovdContentElementData &; SWS_DM_02379
auto GetContent () const noexcept -> DiagnosticSovdContentElementData const &; SWS_DM_02380
GetName 函数

Gets the name of the key.

auto GetName () const noexcept -> ara::core::StringView;
SetContent 函数

Sets the associated content.

auto SetContent (DiagnosticSovdContentElementData content) noexcept -> ara::core::Result< void >;
SetName 函数

Sets the name of the key.

void SetName (ara::core::StringView name) noexcept;

方法文档

函数 GetContent [SWS_DM_02379] Upstream: RS_Diag_04260

auto GetContent () noexcept -> DiagnosticSovdContentElementData &;

Gets the associated content.

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

Rückgabewert

TypBeschreibung
DiagnosticSovdContentElementDataReference to the associated content

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

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

函数 GetContent [SWS_DM_02380] Upstream: RS_Diag_04260

auto GetContent () const noexcept -> DiagnosticSovdContentElementData const &;

Gets the associated content.

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

Rückgabewert

TypBeschreibung
DiagnosticSovdContentReference to the associated content ElementData const

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

Record
AUTOSAR/AP/record/SWS_DM_02380
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02380@rel:R25-11#c3c8264d
Content hash
c3c8264d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02380
Status: valid/unmigrated Version: rel:R25-11#95b7050b 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_02380@rel:R25-11#95b7050b
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

函数 GetName [SWS_DM_02377] Upstream: RS_Diag_04260

auto GetName () const noexcept -> ara::core::StringView;

Gets the name of the key.

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

Rückgabewert

TypBeschreibung
ara::core::StringViewThe name of the key

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

Record
AUTOSAR/AP/record/SWS_DM_02377
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02377@rel:R25-11#6697aa3c
Content hash
6697aa3c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02377
Status: valid/unmigrated Version: rel:R25-11#70bc13b7 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_02377@rel:R25-11#70bc13b7
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

函数 SetContent [SWS_DM_02381] Upstream: RS_Diag_04260

auto SetContent (DiagnosticSovdContentElementData content) noexcept -> ara::core::Result< void >;

Sets the associated content.

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

Parameter (in)

ParameterBeschreibung
contentThe content to set

Rückgabewert

TypBeschreibung
ara::core::Result< void >void result or error if the content is of type ContentData

Fehler

FehlercodeBeschreibung
DiagErrc::kInvalidArgumentrollback_semantics e.g. kPreFailed with internal debouncing

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

Record
AUTOSAR/AP/record/SWS_DM_02381
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02381@rel:R25-11#d66c25b5
Content hash
d66c25b5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02381
Status: valid/unmigrated Version: rel:R25-11#019a85d8 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_02381@rel:R25-11#019a85d8
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

函数 SetName [SWS_DM_02378] Upstream: RS_Diag_04260

void SetName (ara::core::StringView name) noexcept;

Sets the name of the key.

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

Parameter (in)

ParameterBeschreibung
nameThe name of the key

Rückgabewert

TypBeschreibung
None

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

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

函数 ~DiagnosticSovdContentElementDataWithKey [SWS_DM_02376] Upstream: RS_Diag_04260

~DiagnosticSovdContentElementDataWithKey () noexcept;

Declare the Dtor and move/copy constructors/assignments .

Header-Datei#include "ara/diag/diagnostic_sovd_content_element_data.h"
Scopeclass ara::diag::DiagnosticSovdContentElementDataWithKey
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_DM_02376
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_02376@rel:R25-11#db950d05
Content hash
db950d05
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_02376
Status: valid/unmigrated Version: rel:R25-11#c6febcde 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_02376@rel:R25-11#c6febcde
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