DEENESPTFRRUARHIKOZHNL

类 ara::shwa::Id

Diese Seite wurde vollständig KI-generiert auf Basis von SWS Safe Hardware Acceleration (R25-11) — kein offizieller AUTOSAR-Text und keine automatisch extrahierte API-Seite wie die übrigen Module. Als Interpretation gekennzeichnete Aussagen sind Schlussfolgerungen aus den Quellen.

[AP_SWS_SHWA_00701] 原文尚未导入 Upstream: RS_SHWA_00017

template <int Dimensions = 1> class Id final {...};

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

Header-Datei#include "ara/shwa/id.h"
Scopenamespace ara::shwa

用户指南人工智能生成

用作用于寻址硬件和内存资源的多维索引标识符。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5df852eb2dec 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用作用于寻址硬件和内存资源的多维索引标识符。

模板类 ara::shwa::Id 封装了模块 shwa 中的多维标识符,并强制通过静态工厂方法(如 Create [AP_SWS_SHWA_00707])进行受控实例化。作为可复制和可移动的值对象,它允许通过 Get 和 Set [AP_SWS_SHWA_00710] 访问各个维度索引。由于读写访问以及多维工厂都不是线程安全的,因此必要的同步由调用方应用程序负责。

上下文

模板类 ara::shwa::Id 在模块 shwa 内表示用于共享内存或硬件加速器结构的多维标识或索引。它封装了坐标或维度索引,这些坐标或维度索引可以通过静态工厂方法进行实例化,随后进行查询或修改。该类声明为 final,并通过模板参数 Dimensions(默认值为 1)参数化维数。交互伙伴通常是必须寻址对加速器缓冲区或内存资源的结构化访问的应用程序组件。在此过程中,ara::shwa::Id 的实例对象用作用于按维度寻址的紧凑值对象。

生命周期

ara::shwa::Id 的实例化遵循严格的规定:默认构造函数被显式删除 [AP_SWS_SHWA_00702]。因此排除了直接、未初始化的对象创建。相反,创建是通过静态工厂函数 Create 受控进行的,这些工厂函数将对象封装在 ara::core::Result 中返回 [AP_SWS_SHWA_00707]、[AP_SWS_SHWA_00708]、[AP_SWS_SHWA_00709]。根据所需的维度,提供针对一维 [AP_SWS_SHWA_00707]、二维 [AP_SWS_SHWA_00708] 或三维 [AP_SWS_SHWA_00709] 的重载。

在所有权关系方面,ara::shwa::Id 的行为类似于常规值对象。它将复制构造函数 [AP_SWS_SHWA_00703] 和复制赋值运算符 [AP_SWS_SHWA_00704] 均实现为标准化(default)且异常安全(noexcept)。同样,带有 noexcept 的移动构造函数 [AP_SWS_SHWA_00705] 和移动赋值运算符 [AP_SWS_SHWA_00706] 也可用。因此,实例可以高效地存储在容器中、按值传递或在程序各部分之间移动。线程安全需要特别注意:虽然一维工厂方法被指定为线程安全 [AP_SWS_SHWA_00707],但二维和三维工厂方法被显式标明为非线程安全 [AP_SWS_SHWA_00708]、[AP_SWS_SHWA_00709]。在多维索引并行初始化时,调用方必须采取相应的同步措施。

使用路径

典型的使用流程包括通过匹配的工厂调用进行受控实例化、检查 Result 对象以及随后对各个维度执行读取和写入操作。首先,应用程序使用所需的维度边界或索引值调用 Create。成功返回 ara::core::Result<Id> 后,解包其中包含的值。通过常量方法 Get 可以查询特定维度的索引值 [AP_SWS_SHWA_00710]。根据需要,可以通过 Set 随后修改特定维度的值 [AP_SWS_SHWA_00711]。这两种方法(Get 和 Set)均被归类为非线程安全;从多个线程对同一实例的并发访问必须进行外部同步。

Nutzungspfad von ara::shwa::Id应用ara::shwa::IdCreate(dim0)ara::core::Result<Id>altResult 包含值Get(dimension)size_t indexSet(dimension, new_index)Fehlerfall针对 ShwaErrorCode::kRuntime 的错误处理

时序图:Id 对象的工厂创建、值查询和后续修改的典型流程。来源:[AP_SWS_SHWA_00707]、[AP_SWS_SHWA_00710]、[AP_SWS_SHWA_00711]

错误场景

在通过静态 Create 方法创建时可能会发生运行时错误。如果实例化失败,工厂方法会返回一个包含错误码 ShwaErrorCode::kRuntime 的 ara::core::Result [AP_SWS_SHWA_00707]、[AP_SWS_SHWA_00708]、[AP_SWS_SHWA_00709]。因此,在访问实例之前,调用方必须强制使用 HasValue() 检查返回值。所有 Create 函数都保证回滚语义,并声明为异常安全(noexcept)。

在运行期间使用方法 Get 和 Set 时需要注意,根据规范,它们不是异常安全的(not exception safe),并且不能以线程安全的方式工作 [AP_SWS_SHWA_00710]、[AP_SWS_SHWA_00711]。解释:传递超出有效值范围的不合法维度值可能会导致未定义行为或异常,因为针对这些方法上的错误参数未定义单独的错误码。 问题 Q-6983f5f27702e6e8 (未决)调用方在调用前必须确保参数 dimension 位于实例的有效边界之内。

本指南由 AI 助手基于面向 R25-11 的 AUTOSAR 规范生成。

成员图

构造函数和析构函数

1

运算符

1

详细视图

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

构造函数和析构函数

Id 函数 3

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

重载 Id 3
Id ()=delete; AP_SWS_SHWA_00702
Id (Id &&other) noexcept=default; AP_SWS_SHWA_00705
Id (Id const &other) noexcept=default; AP_SWS_SHWA_00703

方法

Create 函数 3

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

重载 Create 3
static ara::core::Result< Id > Create (const std::size_t dim0) noexcept; AP_SWS_SHWA_00707
static ara::core::Result< Id > Create (std::size_t dim0, std::size_t dim1, std::size_t dim2) noexcept; AP_SWS_SHWA_00709
static ara::core::Result< Id > Create (std::size_t dim0, std::size_t dim1) noexcept; AP_SWS_SHWA_00708
Get 函数

Liest die durch die Signatur bezeichnete Information oder Eigenschaft aus dem Objekt.

size_t Get (int dimension) const;
Set 函数

Schreibt den übergebenen Wert an die durch die Signatur bestimmte Stelle.

void Set (int dimension, size_t index);

运算符

operator= 函数 2

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

重载 = 2
Id & operator= (Id &&other) noexcept=default; AP_SWS_SHWA_00706
Id & operator= (const Id &other) noexcept=default; AP_SWS_SHWA_00704

详细信息

函数 Id [AP_SWS_SHWA_00702] Upstream: RS_SHWA_00017

Id ()=delete;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Id

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00702
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00702@rel:R25-11#2b249a53
Content hash
2b249a53
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00702
Status: valid/unmigrated Version: rel:R25-11#833c0ba4 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/AP_SWS_SHWA_00702@rel:R25-11#833c0ba4
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

函数 Id [AP_SWS_SHWA_00705] Upstream: RS_SHWA_00017

Id (Id &&other) noexcept=default;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Id
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00705
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00705@rel:R25-11#a5e39bfc
Content hash
a5e39bfc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00705
Status: valid/unmigrated Version: rel:R25-11#4f69351d 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/AP_SWS_SHWA_00705@rel:R25-11#4f69351d
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= [AP_SWS_SHWA_00706] Upstream: RS_SHWA_00017

Id & operator= (Id &&other) noexcept=default;

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

Scopeclass ara::shwa::Id
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00706
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00706@rel:R25-11#fbc85fc4
Content hash
fbc85fc4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00706
Status: valid/unmigrated Version: rel:R25-11#5eeeb8a4 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/AP_SWS_SHWA_00706@rel:R25-11#5eeeb8a4
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= [AP_SWS_SHWA_00704] Upstream: RS_SHWA_00017

Id & operator= (const Id &other) noexcept=default;

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

Scopeclass ara::shwa::Id
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00704
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00704@rel:R25-11#946f92d1
Content hash
946f92d1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00704
Status: valid/unmigrated Version: rel:R25-11#4bbd86ed 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/AP_SWS_SHWA_00704@rel:R25-11#4bbd86ed
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

函数 Id [AP_SWS_SHWA_00703] Upstream: RS_SHWA_00017

Id (Id const &other) noexcept=default;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Id
Exception Safetyexception safe

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

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

函数 Create [AP_SWS_SHWA_00707] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Id > Create (const std::size_t dim0) noexcept;

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

Scopeclass ara::shwa::Id
Thread Safetythread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k Runtime General runtime error

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00707
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00707@rel:R25-11#213d4842
Content hash
213d4842
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00707
Status: valid/unmigrated Version: rel:R25-11#3e45cfe1 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/AP_SWS_SHWA_00707@rel:R25-11#3e45cfe1
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

函数 Create [AP_SWS_SHWA_00709] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Id > Create (std::size_t dim0, std::size_t dim1, std::size_t dim2) noexcept;

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

Scopeclass ara::shwa::Id
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k Runtime General runtime error

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00709
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00709@rel:R25-11#3a720620
Content hash
3a720620
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00709
Status: valid/unmigrated Version: rel:R25-11#b4c724b1 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/AP_SWS_SHWA_00709@rel:R25-11#b4c724b1
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

函数 Create [AP_SWS_SHWA_00708] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Id > Create (std::size_t dim0, std::size_t dim1) noexcept;

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

Scopeclass ara::shwa::Id
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k Runtime General runtime error

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

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

函数 Get [AP_SWS_SHWA_00710] Upstream: RS_SHWA_00017

size_t Get (int dimension) const;

Liest die durch die Signatur bezeichnete Information oder Eigenschaft aus dem Objekt.

Scopeclass ara::shwa::Id
Thread Safetynot thread-safe
Exception Safetynot exception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00710
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00710@rel:R25-11#b6beb55e
Content hash
b6beb55e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00710
Status: valid/unmigrated Version: rel:R25-11#030f3bd4 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/AP_SWS_SHWA_00710@rel:R25-11#030f3bd4
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

函数 Set [AP_SWS_SHWA_00711] Upstream: RS_SHWA_00017

void Set (int dimension, size_t index);

Schreibt den übergebenen Wert an die durch die Signatur bestimmte Stelle.

Scopeclass ara::shwa::Id
Thread Safetynot thread-safe
Exception Safetynot exception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00711
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00711@rel:R25-11#cd7e0df0
Content hash
cd7e0df0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00711
Status: valid/unmigrated Version: rel:R25-11#8da74c75 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/AP_SWS_SHWA_00711@rel:R25-11#8da74c75
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