DEENESPTFRRUARHIKOZHNL

类 ara::shwa::Range

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_01001] 原文尚未导入 Upstream: RS_SHWA_00017

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

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

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

用户指南人工智能生成

通过受控的工厂创建,将最多三维的范围大小封装为不可变值类型。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9801add965b6 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

通过受控的工厂创建,将最多三维的范围大小封装为不可变值类型。

该类封装了多维范围尺寸,并完全禁止无参实例化 [AP_SWS_SHWA_01002]。对象通过静态工厂方法受控生成,在出错时返回 ShwaErrorCode::kRuntime,成功时提供具有复制和移动语义的异常安全值对象 [AP_SWS_SHWA_01007]。读取单个维度不是线程安全的,需要外部同步 [AP_SWS_SHWA_01010]。

上下文

模板类 ara::shwa::Range 在 Adaptive Platform 模块 shwa 中表示多维范围或尺寸规格(默认通过 Dimensions = 1 参数化)。在贴近硬件或共享内存的架构中,范围对象通常用作最多三个轴上的几何范围或缓冲区尺寸的结构化描述。交互伙伴主要是需要分配、分区或寻址内存区域的应用程序组件和驱动程序服务。该类封装了离散的维度尺寸,并通过接口限制阻止未完全或无效初始化的对象,从而防止错误的直接构造。

生命周期

ara::shwa::Range 实例的生命周期由严格的构造规范决定。无参默认构造函数被显式删除 [AP_SWS_SHWA_01002]。因此排除了在未指定维度的情况下直接创建。相反,创建仅通过静态工厂方法 Create 进行,这些方法针对一维、二维或三维形式进行了重载:一维使用 dim0 [AP_SWS_SHWA_01007],二维使用 dim0 和 dim1 [AP_SWS_SHWA_01008],三维使用 dim0、dim1 和 dim2 [AP_SWS_SHWA_01009]。这些工厂函数中的每一个都返回一个 ara::core::Result<Range>。

成功创建后,该类的行为类似于完整的值类型(Value Type)。它将复制构造函数 [AP_SWS_SHWA_01003] 和通过复制的赋值运算符 [AP_SWS_SHWA_01004] 作为标准化的、异常安全的操作提供(noexcept = default)。此外,还提供了具有相同异常安全性的移动构造函数 [AP_SWS_SHWA_01005] 和移动赋值运算符 [AP_SWS_SHWA_01006]。因此,实例具有明确的值语义,可以轻松传递或保存在容器中。在并发性方面,静态工厂方法被设计为线程安全,而规范将读取检查方法 GetDimension0 [AP_SWS_SHWA_01010]、GetDimension1 [AP_SWS_SHWA_01011] 和 GetDimension2 [AP_SWS_SHWA_01012] 归类为非线程安全。

使用路径

典型的使用路径包括通过静态接口创建范围实例、验证结果,随后读取各维度以进行配置或分配步骤。以下时序图说明了这一过程。

ara::shwa::Range 的使用流程应用ara::shwa::RangeCreate(dim0)Result<Range>altResult 包含值GetDimension0()std::size_tFehlerfallFehlerbehandlung (ShwaErrorCode::kRuntime)

时序图:创建和查询维度时的典型使用流程。来源:[AP_SWS_SHWA_01007]、[AP_SWS_SHWA_01010]

第一步,应用程序调用工厂重载之一,例如针对一维范围调用 Create(dim0) [AP_SWS_SHWA_01007],或针对多维配置调用 Create(dim0, dim1) [AP_SWS_SHWA_01008] 或 Create(dim0, dim1, dim2) [AP_SWS_SHWA_01009]。调用层随后检查返回的 ara::core::Result 是否成功。如果存在有效值,则解引用或移动 Range 对象。随后,后续函数可以通过 GetDimension0 [AP_SWS_SHWA_01010] 以及根据需要通过 GetDimension1 [AP_SWS_SHWA_01011] 和 GetDimension2 [AP_SWS_SHWA_01012] 查询所包含的轴大小,并将其用于缓冲区操作。

错误场景

使用 Create 创建时可能会发生导致初始化失败的错误条件。在这种情况下,工厂不返回初始化的对象,而是返回类型为 ShwaErrorCode::kRuntime(“General runtime error”)的错误结果 [AP_SWS_SHWA_01007]、[AP_SWS_SHWA_01008]、[AP_SWS_SHWA_01009]。对于所有工厂变体,规范保证了回滚语义和异常安全性(noexcept),因此在发生错误时不会残留部分状态或引起不一致。

对于检查方法 GetDimension0 [AP_SWS_SHWA_01010]、GetDimension1 [AP_SWS_SHWA_01011] 和 GetDimension2 [AP_SWS_SHWA_01012],未规定返回错误代码,但规范将其标明为非异常安全(not exception safe)和非线程安全(not thread-safe)。因此,调用方承担跨线程安全访问的前置条件。此外,调用超出使用模板参数 Dimensions 实例化的维度数量的维度查询(例如在一维配置中调用 GetDimension2)推测是不允许的,并将导致错误。 问题 Q-794519baf2ea8a5e (未决)

本指南完全基于 AUTOSAR Adaptive R25-11 中 ara::shwa::Range 的接口规范。

成员图

构造函数和析构函数

1

运算符

1

详细视图

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

构造函数和析构函数

Range 函数 3

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

重载 Range 3
Range ()=delete; AP_SWS_SHWA_01002
Range (Range &&other) noexcept=default; AP_SWS_SHWA_01005
Range (Range const &other) noexcept=default; AP_SWS_SHWA_01003

方法

Create 函数 3

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

重载 Create 3
static ara::core::Result< Range > Create (const std::size_t dim0) noexcept; AP_SWS_SHWA_01007
static ara::core::Result< Range > Create (std::size_t dim0, std::size_t dim1, std::size_t dim2) noexcept; AP_SWS_SHWA_01009
static ara::core::Result< Range > Create (std::size_t dim0, std::size_t dim1) noexcept; AP_SWS_SHWA_01008

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

std::size_t GetDimension0 () const;

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

std::size_t GetDimension1 () const;

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

std::size_t GetDimension2 () const;

运算符

operator= 函数 2

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

重载 = 2
Range & operator= (Range &&other) noexcept=default; AP_SWS_SHWA_01006
Range & operator= (const Range &other) noexcept=default; AP_SWS_SHWA_01004

详细信息

函数 Range [AP_SWS_SHWA_01002] Upstream: RS_SHWA_00017

Range ()=delete;

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

Scopeclass ara::shwa::Range

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

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

函数 Range [AP_SWS_SHWA_01005] Upstream: RS_SHWA_00017

Range (Range &&other) noexcept=default;

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

Scopeclass ara::shwa::Range
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01005
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01005@rel:R25-11#bae7fecb
Content hash
bae7fecb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01005
Status: valid/unmigrated Version: rel:R25-11#c90c6999 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_01005@rel:R25-11#c90c6999
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_01006] Upstream: RS_SHWA_00017

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

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

Scopeclass ara::shwa::Range
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01006
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01006@rel:R25-11#568aa604
Content hash
568aa604
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01006
Status: valid/unmigrated Version: rel:R25-11#2a073de4 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_01006@rel:R25-11#2a073de4
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_01004] Upstream: RS_SHWA_00017

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

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

Scopeclass ara::shwa::Range
Exception Safetyexception safe

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

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

函数 Range [AP_SWS_SHWA_01003] Upstream: RS_SHWA_00017

Range (Range const &other) noexcept=default;

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

Scopeclass ara::shwa::Range
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01003
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01003@rel:R25-11#d984ff51
Content hash
d984ff51
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01003
Status: valid/unmigrated Version: rel:R25-11#eac65ea5 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_01003@rel:R25-11#eac65ea5
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_01007] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Range > 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::Range
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_01007
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01007@rel:R25-11#21c56149
Content hash
21c56149
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01007
Status: valid/unmigrated Version: rel:R25-11#d6c4461a 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_01007@rel:R25-11#d6c4461a
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_01009] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Range > 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::Range
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_01009
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01009@rel:R25-11#b5168a13
Content hash
b5168a13
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01009
Status: valid/unmigrated Version: rel:R25-11#0dcb9b8c 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_01009@rel:R25-11#0dcb9b8c
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_01008] Upstream: RS_SHWA_00017, RS_SHWA_00007

static ara::core::Result< Range > 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::Range
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_01008
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01008@rel:R25-11#6cddbc4e
Content hash
6cddbc4e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01008
Status: valid/unmigrated Version: rel:R25-11#c5dd729d 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_01008@rel:R25-11#c5dd729d
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

函数 GetDimension0 [AP_SWS_SHWA_01010] Upstream: RS_SHWA_00017

std::size_t GetDimension0 () const;

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

Scopeclass ara::shwa::Range
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_01010
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01010@rel:R25-11#94ec05d6
Content hash
94ec05d6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01010
Status: valid/unmigrated Version: rel:R25-11#2483c373 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_01010@rel:R25-11#2483c373
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

函数 GetDimension1 [AP_SWS_SHWA_01011] Upstream: RS_SHWA_00017

std::size_t GetDimension1 () const;

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

Scopeclass ara::shwa::Range
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_01011
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01011@rel:R25-11#626c1b0f
Content hash
626c1b0f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01011
Status: valid/unmigrated Version: rel:R25-11#5274ad1b 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_01011@rel:R25-11#5274ad1b
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

函数 GetDimension2 [AP_SWS_SHWA_01012] Upstream: RS_SHWA_00017

std::size_t GetDimension2 () const;

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

Scopeclass ara::shwa::Range
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_01012
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01012@rel:R25-11#71d050d5
Content hash
71d050d5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01012
Status: valid/unmigrated Version: rel:R25-11#ded38889 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_01012@rel:R25-11#ded38889
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