DEENESPTFRRUARHIKOZHNL

类 ara::com::SamplePtr

[SWS_CM_00306] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

template <typename T> class SamplePtr {...};

Emulates a std::unique_ptr to an event sample.

The ara::com::SamplePtr behaves as a std::unique_ptr as long as the event/ field is subscribed to, or the Proxy it belongs to is not destroyed. The precondition defined in [SWS_CM_00085] and [SWS_CM_00087] must be fulfilled. Otherwise it is considered a violation.

Note: The SamplePtr is always passed with a const SampleType to the callable in GetNewSamples() (see [SWS_CM_00701]). Therefore the sample datatype (typename T) and the SamplePtr operators using the sample datatype (typename T) are implicitly declared as const. This means that the sample data will always be read-only.

Header-Datei#include "ara/com/service/sample_ptr.h"
Forwarding-Header#include "ara/com/com_fwd.h"
Scopenamespace ara::com

用户指南人工智能生成

支持对接收到的事件进行独占读取访问,并控制中间件内存的生命周期。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f5d97c2beaf2 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持对接收到的事件进行独占读取访问,并控制中间件内存的生命周期。

该模板类仿照 std::unique_ptr 封装了接收到的事件样本的独占所有权,并授予应用程序对中间件缓冲区的直接、不可变读取访问权限(EXP ARAComAPI §5.3.5.4)。实例在新样本查询时传入,仅可通过移动语义进行传递,并持续占用存储空间([SWS_CM_11537])。只有当指针销毁或显式置空时,才会重新释放缓冲区槽。其有效性前提是事件保持订阅状态且对应的代理存在。

上下文

模板类 ara::com::SamplePtr 在 Adaptive Platform 中构成了接收到的事件数据(Event Samples)的核心访问与所有权模型(EXP ARAComAPI §5.3.5.4)。在语义上,该类仿照 std::unique_ptr 模拟了一个独占智能指针(EXP ARAComAPI §5.3.5.4)。主要交互对象为应用层、接收端事件对象或代理对象,以及管理缓冲区资源的底层通信中间件 ara::com(EXP ARAComAPI, 第44页, EXP ARAComAPI, 第50页)。

该概念明确采用基于引用的零拷贝方法:ara::com 不通过按值复制将事件数据传递给应用程序,而是转发指向中央通信缓冲区的指针或引用(EXP ARAComAPI, 第50页)。在典型的 1:N 分发场景中,本地事件缓存因此可以纯粹通过引用更新来供给,从而最大程度地减少了内存开销和延迟(EXP ARAComAPI, 第50页)。对有效负载数据的访问在概念上被严格设计为只读:在提供时,SamplePtr 始终使用常量有效负载类型进行实例化(ara::com::SamplePtr<SampleType const>),因此所有访问运算符隐式为 const(EXP ARAComAPI, 第39页, EXP ARAComAPI, 第44页, [SWS_CM_00701])。

生命周期

SamplePtr 的实例可通过默认构造函数或使用 nullptr 创建为空指针([SWS_CM_11534], [SWS_CM_11535])。相反,包含有效负载数据的有效实例则在中间件内将事件反序列化到缓冲区槽时生成,并在 GetNewSamples() 范围内传递给应用端 Callable(EXP ARAComAPI, 第44页)。

随着传入的发生,向应用程序进行完整的所有权转移(Ownership Transfer)(EXP ARAComAPI §5.3.5.4)。为保证所有权的独占性,拷贝构造函数和拷贝赋值运算符已被删除([SWS_CM_11536], [SWS_CM_11538])。被管理存储槽的转移仅可通过移动构造或移动赋值进行([SWS_CM_11537], [SWS_CM_11540]),而 Swap() 允许交换两个指针的内容([SWS_CM_11544])。

只要 SamplePtr 实例存在并持有样本,中间件就无法收回或覆写所占用的存储空间(EXP ARAComAPI §5.3.5.4)。只有当通过调用析构函数使 SamplePtr 的生命周期结束([SWS_CM_11547]),或通过 Reset(nullptr) 亦或赋值 nullptr 显式清空指针时([SWS_CM_11539], [SWS_CM_11545]),中间件槽才会被释放。

diag_lebenszyklus Init Leer Leer (nullptr) Init->Leer SamplePtr() Verwaltend Verwaltend (Exklusiver Besitz) Init->Verwaltend GetNewSamples() Leer->Verwaltend Move-Zuweisung Zerstoert 已销毁 Leer->Zerstoert ~SamplePtr() Verwaltend->Leer Reset(nullptr) Verwaltend->Verwaltend Swap() Verwaltend->Zerstoert ~SamplePtr()

状态图:SamplePtr 的生命周期阶段与所有权转移。来源:[SWS_CM_11534], [SWS_CM_11537], [SWS_CM_11545], [SWS_CM_11547], EXP ARAComAPI §5.3.5.4。

使用路径

数据访问的典型流程划分为以下步骤:

  1. 触发样本查询:应用程序在事件代理上调用 GetNewSamples(),并传入具有签名 void(ara::com::SamplePtr<SampleType const>) 的合适回调函数以及要提取的样本数量上限(EXP ARAComAPI, 第44页)。
  2. 传递给回调:若存在新数据且缓冲区配额未耗尽,中间件将反序列化样本并将新的 SamplePtr 实例传递给回调(EXP ARAComAPI, 第44页)。
  3. 检查端到端状态:应用程序可通过 GetProfileCheckStatus() 查询当前数据包的 E2E 保护检查结果([SWS_CM_90420])。
  4. 读取数据:应用逻辑通过 operator*([SWS_CM_11541])、operator->([SWS_CM_11542])或方法 Get()([SWS_CM_11546])以只读方式访问受管对象。
  5. 进一步处理或释放:若样本需要在回调之外进行持久化,应用程序通过移动构造将指针移入自身的存储结构中([SWS_CM_11537])。若指针保留在回调的作用域内,则在退出时自动销毁([SWS_CM_11547]),从而立即释放中间件中的槽(EXP ARAComAPI §5.3.5.4)。
样本提供与内存管理流程应用Proxy / Eventara::com MiddlewareGetNewSamples(f, maxNumberOfSamples)根据配额检查持有的样本alt超出配额返回 ErrorCode缓冲区包含新样本Deserialisierung in Sample-Slotf(SamplePtr<SampleType const>)获取所有权;通过 * / -> / Get() 进行读访问以及 E2E 检查销毁 (~SamplePtr) 或 Reset(nullptr)释放存储槽Result(Anzahl verarbeiteter Samples)

时序图:GetNewSamples() 中伴随所有权转移与缓冲区释放的交互时序。来源:[SWS_CM_11541], [SWS_CM_11547], [SWS_CM_90420], EXP ARAComAPI, 第44页, EXP ARAComAPI §5.3.5.4。

错误场景

在使用 SamplePtr 时,需注意特定的边界条件和错误源:

  • 缓冲区配额耗尽:中间件在每次调用 GetNewSamples() 时都会监控应用程序当前持有的样本数量是否超过先前在调用 Subscribe() 时承诺的配额。若配额超限,GetNewSamples() 将拒绝输出更多样本,而是返回 ara::core::ErrorCode(EXP ARAComAPI, 第44页, EXP ARAComAPI, 第45页)。
  • 因订阅丢失或代理销毁导致的失效:仅当底层事件保持订阅状态且上层代理实例存在时,SamplePtr 的表现才具有类似 std::unique_ptr 的确定性。在订阅结束或代理销毁之后继续保留指针被视为违反前置条件。
  • 指针有效性与空状态:可通过 operator bool() 评估指针的占用状态([SWS_CM_11543])。通过 operator* 或 operator-> 解引用空指针会导致未定义行为。所有访问和修改方法均声明为 noexcept([SWS_CM_11541], [SWS_CM_11542], [SWS_CM_11546])。
  • E2E 校验错误:有效接收到的指针并不一定保证传输数据无误;应用程序必须通过 GetProfileCheckStatus() 的返回值检查端到端保护是否指示数据损坏或传输延迟([SWS_CM_90420])。

本类指南由 AI 管理助手基于 Adaptive Platform Release R25-11 的 AUTOSAR 规范生成。

成员图

类图

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

G nara__com__SamplePtr589 SamplePtr + SamplePtr() + operator=() + ~SamplePtr() + Get() + GetProfileCheckStatus() + Reset() + Swap() + operator bool() + operator*() + operator->()

详细视图

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

构造函数和析构函数

SamplePtr 函数 4

Default constructor

重载 SamplePtr 4
constexpr SamplePtr () noexcept; SWS_CM_11534
constexpr SamplePtr (std::nullptr_t other) noexcept; SWS_CM_11535
SamplePtr (const SamplePtr &)=delete; SWS_CM_11536
SamplePtr (SamplePtr &&other) noexcept; SWS_CM_11537
~SamplePtr 函数

Destructor

~SamplePtr () noexcept;

方法

Get 函数

Returns a pointer to the managed object.

T * Get () const noexcept;

Returns the E2E protection check result

ara::com::e2e::ProfileCheckStatus GetProfileCheckStatus () const noexcept;
Reset 函数

Replaces the managed object.

void Reset (std::nullptr_t other) noexcept;
Swap 函数

Swaps the managed object.

void Swap (SamplePtr &other) noexcept;

运算符

Checks if the stored pointer is null

explicit operator bool () const noexcept;
operator* 函数

Dereferences the stored pointer.

T & operator* () const noexcept;
operator-> 函数

Dereferences the stored pointer.

T * operator-> () const noexcept;
operator= 函数 3

Copy assignment constructor deletion

重载 = 3
SamplePtr & operator= (const SamplePtr &)=delete; SWS_CM_11538
SamplePtr & operator= (std::nullptr_t other) noexcept; SWS_CM_11539
SamplePtr & operator= (SamplePtr &&other) noexcept; SWS_CM_11540

方法文档

函数 Get [SWS_CM_11546] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

T * Get () const noexcept;

Returns a pointer to the managed object.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 1cc8beae7ae3 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 Get 是来自头文件 ara/com/service/sample_ptr.h [SWS_CM_11546] 的类 ara::com::SamplePtr 的无参数成员函数。它同步返回类型为 T* 的裸指针,指向该实例管理的对象 [SWS_CM_11546]。与提供 ara::core::Future [SWS_CM_00112] 的服务字段异步查询不同,此访问直接在调用线程中发生。

错误处理与边界条件

该方法被声明为 noexcept 并被指定为异常安全(exception safe)[SWS_CM_11546];不会通过 C++ 异常出现错误状态。如果该实例当前未管理任何对象,则返回的指针推测可能是 nullptr。 问题 Q-d850bd8ee144369a (未决)在进一步处理所引用的数据之前,必须确保 E2E 监督处于状态 ara::com::e2e::SMState::kValid 且配置文件的状态检查未产生错误 [SWS_CM_90422]。

相互协作与区分

在通信管理中,Get 用于对接收到的值(样本)进行直接数据访问,正如在样本管理框架中提供的那样 AUTOSAR_AP_EXP_ARAComAPI §10 “GetNewSamples”。该函数与其他 Get 操作有着明确的区别:

  • 字段 Getter:代理上的服务字段检索通过 Get() 完成,返回 ara::core::Future [SWS_CM_00112],为此可以在服务器端注册处理程序 [SWS_CM_00114]。
  • E2E 状态:字段 Getter 的监督状态通过 GetE2EStateMachineStateGetter 单独确定 [SWS_CM_00145]。

本文字由 AI 生成,并基于 AUTOSAR 版本 R25-11。

实现者指南即将推出(复杂度 I2)

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
T*A pointer to the managed object

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

Record
AUTOSAR/AP/record/SWS_CM_11546
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11546@rel:R25-11#1c0dcfc1
Content hash
1c0dcfc1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11546
Status: valid/unmigrated Version: rel:R25-11#ff040cc4 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11546@rel:R25-11#ff040cc4
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#19683df22026-09-30
  • R24-11rel:R24-11#83411fd82026-10-14
  • R25-11rel:R25-11#ff040cc42026-10-14 active
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

函数 GetProfileCheckStatus [SWS_CM_90420] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

ara::com::e2e::ProfileCheckStatus GetProfileCheckStatus () const noexcept;

Returns the E2E protection check result

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
ara::com::e2e::ProfileCheckStatusThe ara::com::e2e::ProfileCheckStatus

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

Record
AUTOSAR/AP/record/SWS_CM_90420
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_90420@rel:R25-11#509aea81
Content hash
509aea81
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_90420
Status: valid/unmigrated Version: rel:R25-11#0b9ab03a Versionshistorie & Revisions (1 transition, 8 revision)
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_CM_90420@rel:R25-11#0b9ab03a
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#35d072212026-09-30
  • R19-11rel:R19-11#8060df8d2026-10-14
  • R20-11rel:R20-11#8060df8d2026-10-14
  • R21-11rel:R21-11#8060df8d2026-10-14
  • R22-11rel:R22-11#8060df8d2026-10-14
  • R23-11rel:R23-11#8060df8d2026-10-14
  • R24-11rel:R24-11#331b13032026-10-14
  • R25-11rel:R25-11#0b9ab03a2026-10-14 active
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

函数 Reset [SWS_CM_11545] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

void Reset (std::nullptr_t other) noexcept;

Replaces the managed object.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0a03c7966b10 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::com::SamplePtr 的成员函数 Reset 用于重置指向受管对象 [SWS_CM_11545] 的指针。它接收类型为 std::nullptr_t 的值 other 作为参数。该调用将当前持有的对象替换为空指针,并且不返回值(void)[SWS_CM_11545]。

在错误处理和异常安全性方面,该方法声明为 noexcept,并被指定为完全异常安全(exception safe)[SWS_CM_11545]。既不抛出 C++ 异常,也不返回特定的错误代码。

在整个系统中,释放 SamplePtr 实例满足了避免内存错误的一项重要前置条件:

解释:在应用场景中,当指针未自动离开其作用域时,显式调用 Reset(nullptr) 可能是确定性放弃事件样本所有权以进行此类生命周期转换的直接手段。 问题 Q-a615fa4078ab03ce (未决)

本使用说明基于 AUTOSAR 规范 R25-11 自动创建。

实现者指南即将推出(复杂度 I2)

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherA replacing std::nullptr_t

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_11545
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11545@rel:R25-11#c971315b
Content hash
c971315b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11545
Status: valid/unmigrated Version: rel:R25-11#93bd20e9 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11545@rel:R25-11#93bd20e9
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#82ec68c82026-09-30
  • R24-11rel:R24-11#d3c7100f2026-10-14
  • R25-11rel:R25-11#93bd20e92026-10-14 active
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

函数 SamplePtr [SWS_CM_11534] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

constexpr SamplePtr () noexcept;

Default constructor

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

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

Record
AUTOSAR/AP/record/SWS_CM_11534
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11534@rel:R25-11#79fdc388
Content hash
79fdc388
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11534
Status: valid/unmigrated Version: rel:R25-11#d0884e08 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11534@rel:R25-11#d0884e08
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#b186477a2026-09-30
  • R24-11rel:R24-11#78fdb2182026-10-14
  • R25-11rel:R25-11#d0884e082026-10-14 active
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

函数 SamplePtr [SWS_CM_11535] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

constexpr SamplePtr (std::nullptr_t other) noexcept;

Semantically equivalent to [SWS_CM_11534]

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherA std::nullptr_t to copy

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

Record
AUTOSAR/AP/record/SWS_CM_11535
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11535@rel:R25-11#3ad73461
Content hash
3ad73461
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11535
Status: valid/unmigrated Version: rel:R25-11#6e679051 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11535@rel:R25-11#6e679051
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#fa854bdf2026-09-30
  • R24-11rel:R24-11#123387c32026-10-14
  • R25-11rel:R25-11#6e6790512026-10-14 active
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

函数 SamplePtr [SWS_CM_11536] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

SamplePtr (const SamplePtr &)=delete;

Copy constructor deletion

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr

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

Record
AUTOSAR/AP/record/SWS_CM_11536
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11536@rel:R25-11#295935d2
Content hash
295935d2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11536
Status: valid/unmigrated Version: rel:R25-11#1ab46188 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11536@rel:R25-11#1ab46188
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#3909673e2026-09-30
  • R24-11rel:R24-11#1ab461882026-10-14
  • R25-11rel:R25-11#1ab461882026-10-14 active
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

函数 SamplePtr [SWS_CM_11537] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

SamplePtr (SamplePtr &&other) noexcept;

Move constructor

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherOther ara::com::SamplePtr to move

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

Record
AUTOSAR/AP/record/SWS_CM_11537
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11537@rel:R25-11#55a559f2
Content hash
55a559f2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11537
Status: valid/unmigrated Version: rel:R25-11#3c5f39c0 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11537@rel:R25-11#3c5f39c0
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#0fee22422026-09-30
  • R24-11rel:R24-11#165c3cab2026-10-14
  • R25-11rel:R25-11#3c5f39c02026-10-14 active
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

函数 Swap [SWS_CM_11544] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

void Swap (SamplePtr &other) noexcept;

Swaps the managed object.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 18d4b3f3f0f9 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

函数 Swap 是类 ara::com::SamplePtr 的成员方法,用于将当前管理的对象与另一个实例进行交换([SWS_CM_11544])。该接口在头文件 ara/com/service/sample_ptr.h 中定义(AUTOSAR_AP_SWS_CommunicationManagement §8.9.1.1.3.4 “Swap”)。

该调用为同步调用,并需要以下参数:

  • other:对 ara::com::SamplePtr 的另一个实例的引用,其管理的对象将与 *this 的对象进行交换([SWS_CM_11544])。

该方法没有返回值(void)([SWS_CM_11544])。

错误处理

其签名声明为 noexcept,并被归类为异常安全(exception safe)([SWS_CM_11544])。该调用不会引发异常,也不会返回错误代码。

并发性与限制

由于 Swap 同时修改了两个对象(*this 和 other)的状态,因此在未经外部同步的情况下,在所涉及的至少一个实例上进行并行调用推测可能不是线程安全的。 问题 Q-d906e8c05aefbd15 (未决)

相互作用

该方法是类 ara::com::SamplePtr 的组成部分([SWS_CM_11544])。它能够在通信流程中高效地转移所有权或重新分配接收到的数据样本,而无需复制底层有效负载对象。

本使用说明基于规范文档自动生成。

实现者指南即将推出(复杂度 I2)

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherAnother ara::com::SamplePtr to swap the managed object with

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_11544
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11544@rel:R25-11#dac436a8
Content hash
dac436a8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11544
Status: valid/unmigrated Version: rel:R25-11#de8dd35c Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11544@rel:R25-11#de8dd35c
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#ef3edceb2026-09-30
  • R24-11rel:R24-11#f0b647d12026-10-14
  • R25-11rel:R25-11#de8dd35c2026-10-14 active
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 bool [SWS_CM_11543] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

explicit operator bool () const noexcept;

Checks if the stored pointer is null

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
boolTRUE if the stored pointer is null, FALSE otherwise.

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

Record
AUTOSAR/AP/record/SWS_CM_11543
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11543@rel:R25-11#7e0052ad
Content hash
7e0052ad
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11543
Status: valid/unmigrated Version: rel:R25-11#d4a800ef Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11543@rel:R25-11#d4a800ef
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#a426ffae2026-09-30
  • R24-11rel:R24-11#6ef9c5c82026-10-14
  • R25-11rel:R25-11#d4a800ef2026-10-14 active
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_CM_11541] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

T & operator* () const noexcept;

Dereferences the stored pointer.

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
T&The object owned by *this

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

Record
AUTOSAR/AP/record/SWS_CM_11541
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11541@rel:R25-11#264f9c6a
Content hash
264f9c6a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11541
Status: valid/unmigrated Version: rel:R25-11#2a9978a3 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11541@rel:R25-11#2a9978a3
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#7a10ec442026-09-30
  • R24-11rel:R24-11#ef9b07162026-10-14
  • R25-11rel:R25-11#2a9978a32026-10-14 active
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_CM_11542] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

T * operator-> () const noexcept;

Dereferences the stored pointer.

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
T*A pointer to the object owned by *this

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

Record
AUTOSAR/AP/record/SWS_CM_11542
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11542@rel:R25-11#7771c305
Content hash
7771c305
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11542
Status: valid/unmigrated Version: rel:R25-11#40fe26b3 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11542@rel:R25-11#40fe26b3
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#782b36dc2026-09-30
  • R24-11rel:R24-11#bcd1f0962026-10-14
  • R25-11rel:R25-11#40fe26b32026-10-14 active
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_CM_11538] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

SamplePtr & operator= (const SamplePtr &)=delete;

Copy assignment constructor deletion

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr

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

Record
AUTOSAR/AP/record/SWS_CM_11538
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11538@rel:R25-11#42db6168
Content hash
42db6168
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11538
Status: valid/unmigrated Version: rel:R25-11#26e1191d Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11538@rel:R25-11#26e1191d
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#474e38fe2026-09-30
  • R24-11rel:R24-11#26e1191d2026-10-14
  • R25-11rel:R25-11#26e1191d2026-10-14 active
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_CM_11539] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

SamplePtr & operator= (std::nullptr_t other) noexcept;

Copy assignment of nullptr_t.

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherA std::nullptr_t to copy

Rückgabewert

TypBeschreibung
SamplePtr &New ara::com::SamplePtr

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

Record
AUTOSAR/AP/record/SWS_CM_11539
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11539@rel:R25-11#305edcee
Content hash
305edcee
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11539
Status: valid/unmigrated Version: rel:R25-11#f4df352d Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11539@rel:R25-11#f4df352d
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#3c9545952026-09-30
  • R24-11rel:R24-11#2a2a48bc2026-10-14
  • R25-11rel:R25-11#f4df352d2026-10-14 active
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_CM_11540] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

SamplePtr & operator= (SamplePtr &&other) noexcept;

Move assignment operator.

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
otherOther ara::com::SamplePtr to move

Rückgabewert

TypBeschreibung
SamplePtr &New ara::com::SamplePtr

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

Record
AUTOSAR/AP/record/SWS_CM_11540
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11540@rel:R25-11#14fcef3f
Content hash
14fcef3f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11540
Status: valid/unmigrated Version: rel:R25-11#19726bd5 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11540@rel:R25-11#19726bd5
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#d5c9766f2026-09-30
  • R24-11rel:R24-11#0e9fed532026-10-14
  • R25-11rel:R25-11#19726bd52026-10-14 active
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

函数 ~SamplePtr [SWS_CM_11547] Upstream: RS_CM_00202, RS_CM_00203, RS_AP_00114, RS_AP_00122, RS_AP_00135, RS_AP_00145

~SamplePtr () noexcept;

Destructor

Header-Datei#include "ara/com/service/sample_ptr.h"
Scopeclass ara::com::SamplePtr
Exception-Sicherheitexception safe

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

Record
AUTOSAR/AP/record/SWS_CM_11547
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11547@rel:R25-11#32e20f0c
Content hash
32e20f0c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11547
Status: valid/unmigrated Version: rel:R25-11#9a0210b5 Versionshistorie & Revisions (1 transition, 3 revision)
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_CM_11547@rel:R25-11#9a0210b5
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#79b025ea2026-09-30
  • R24-11rel:R24-11#12a7c5cb2026-10-14
  • R25-11rel:R25-11#9a0210b52026-10-14 active
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