DEENESPTFRRUARHIKOZHNL

类 <SI-Namespace>::skeleton:: events::<Event>

用户指南人工智能生成

使服务提供者能够在服务器端向订阅应用程序发送事件。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 61a657b4f5c6 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使服务提供者能够在服务器端向订阅应用程序发送事件。

类 <SI-Namespace>::skeleton::events::<Event> 用于 AUTOSAR Adaptive Platform 上的服务提供者向订阅应用程序发布事件数据。事件既可以基于复制发送,也可以通过预先由 Allocate() 分配的缓冲区高效地进行零复制发送([SWS_CM_90438])。通过 Send() 的发送调用强制要求此前已成功提供相应的服务实例,并遵守配置的最小发送间隔([SWS_CM_00162])。

上下文

类 <SI-Namespace>::skeleton::events::<Event> 表示在 AUTOSAR Adaptive Platform 内发布服务事件的服务器端接口。它允许服务应用程序(Skeleton)将类型为 SampleType([SWS_CM_11400])的更新事件数据异步传输至所有订阅的客户端应用程序([SWS_CM_00162])。在此过程中,Skeleton 直接与通信层(Communication Management)交互,后者负责查找服务实例并物理分发事件数据。除了发送数据外,Event 实例还监视当前订阅状态,并将订阅者群体的变更告知服务提供者([SWS_CM_12008]、[SWS_CM_12011])。

EventKontext Application Anwendungs-Skeleton Event <SI-Namespace>::skeleton::events::<Event> Application->Event Send() / Allocate() Event->Application SubscriptionState ComMgt Communication Management Event->ComMgt Datenweitergabe ComMgt->Event Abonnement-Zustand Subscribers Abonnierende Anwendungen ComMgt->Subscribers Event-Verteilung

上下文图:Event 类与服务提供者、Communication Management 及订阅者的交互。来源:[SWS_CM_00162]、[SWS_CM_90437]、[SWS_CM_12011]

生命周期

Event 类的实例化与上层 Skeleton 服务实例联合进行。推测 Event 实例的生命周期与 Skeleton 的生命周期紧密绑定,因此事件对象仅在服务构造完成后才可用,并随着服务的销毁而终止。 问题 Q-4e733f93c853a3eb (未决)在进行活动数据传输之前必须已经提供该服务,因为在提供服务之前的传输尝试将会失败([SWS_CM_00162])。

在运行阶段,该实例反映订阅者连接的状态。可通过 GetSubscriptionState() 查询当前状态([SWS_CM_12011])。为了对状态变更做出异步响应,应用程序使用 SetSubscriptionStateChangeHandler() 注册相应的回调([SWS_CM_12008]),并可选择通过 Executor 对象耦合到特定的执行上下文([SWS_CM_12009])。在服务终止或重置方向时,可通过 UnsetSubscriptionStateChangeHandler() 再次注销此处理程序([SWS_CM_12010])。所有状态查询和处理程序方法均声明为 noexcept,并确保异常安全性([SWS_CM_12008]、[SWS_CM_12011])。

使用路径

服务应用程序有两种基本的传输模式可用于发布 Event 数据:基于复制的传输以及通过托管内存的零复制机制(EXP ara::com API 第10页)。

在常规使用路径中,服务提供者首先在需要时为订阅变更注册回调([SWS_CM_12008])。一旦存在订阅者,应用程序要么生成本地数据并将其按值传递给 Send()([SWS_CM_00162]),此时 Communication Management 会创建数据的副本并转发给所有订阅者(EXP ara::com API 第10页)。

或者,为了避免复制开销,应用程序通过 Allocate() 直接从通信层请求形式为 ara::com::SampleAllocateePtr<SampleType> 的内存缓冲区([SWS_CM_90438]、EXP ara::com API 第10页)。填充缓冲区后,通过 Send() 的专用重载进行传输([SWS_CM_90437])。解读:发送后,该内存的所有权可能会完全转移给 Communication Management,因为明确禁止应用程序在调用后对数据进行任何进一步访问([SWS_CM_90437])。 问题 Q-86aba8c6f9bf42e9 (未决)

骨架处的事件传输流程Anwendung (Skeleton)Event-ObjektCommunication ManagementUse Case: Handler-RegistrierungSetSubscriptionStateChangeHandler(handler)Abonnement-Handler registrierenUse Case: 变体 1:使用 Allocate 的零拷贝传输Allocate()Speicherpuffer reservierenSampleAllocateePtrSampleAllocateePtrPufferdaten schreibenSend(ptr)将数据传输给订阅者Result<void>Result<void>Use Case: 变体 2:基于拷贝的传输Send(data)创建副本并传输Result<void>Result<void>

时序图:包括处理程序注册和分配在内的 Event 传输典型流程。来源:[SWS_CM_12008]、[SWS_CM_90438]、[SWS_CM_90437]、[SWS_CM_00162]

错误场景

对 Send() 的调用返回一个 ara::core::Result<void>,在发生错误时包含类型为 ara::com::ComErrc 的相应错误代码([SWS_CM_00162]、[SWS_CM_90437])。定义的错误情况包括:

  • ComErrc::kServiceNotOffered:在尝试发送之前,服务尚未通过 OfferService() 提供([SWS_CM_00162]、[SWS_CM_90437])。
  • ComErrc::kMinimumSendIntervalViolationError:低于为该事件配置的最小发送间隔(minimumSendInterval),因为发送调用发起的频率过快([SWS_CM_00162]、[SWS_CM_90437])。

此外,在分配和处理程序配置时需注意前置条件:

  • Allocate() 不是异常安全的(not exception safe),并且在内存资源不足时会导致 SampleAllocationViolation,或在不当使用自定义分配器时导致 AllocateUsageViolation([SWS_CM_90438])。
  • SetSubscriptionStateChangeHandler() 需要一个有效的、可调用的函数对象;如果传递了空值或不存在的处理程序,则会导致 InvalidHandlerViolation([SWS_CM_12008]、[SWS_CM_12009])。

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

成员图

类图

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

G n_SI_Namespace___skeleton___events___Event_831 <Event> + Allocate() + Send() + GetSubscriptionState() + SetSubscriptionStateChangeHandler() + UnsetSubscriptionStateChangeHandler()

详细视图

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

方法

Allocate 函数

Allocating data for event transfer when Communication Management is responsible for the data.

Query ara::com::SubscriptionState of an event.

ara::com::SubscriptionState GetSubscriptionState () const noexcept;
Send 函数 2

Send event where the application is responsible for the data. The Communication Management creates a copy of the data to send and sends it to all subscribing applications.

重载 Send 2
ara::core::Result< void > Send (<SSampleDerivedType> data) noexcept; SWS_CM_00162
ara::core::Result< void > Send (ara::com::SampleAllocateePtr< Sample Type > data) noexcept; SWS_CM_90437

Set/Register ara::com::SubscriptionState change handler

重载 SetSubscriptionStateChangeHandler 2
void SetSubscriptionStateChangeHandler (ara::com::SubscriptionState ChangeHandler handler) noexcept; SWS_CM_12008
template <typename ExecutorT> void SetSubscriptionStateChangeHandler (ara::com::SubscriptionState ChangeHandler handler, ExecutorT &&executor) noexcept; SWS_CM_12009

Unset/Deregister the ara::com::SubscriptionState change handler

void UnsetSubscriptionStateChangeHandler () noexcept;

类型别名

SampleType 类型别名

Data type for the value of an event sample (the CppImplementationDataType of the Event, i.e. for the CppImplementationDataType which is either referenced by the VariableDataPrototype in the role type directly or via the indirection of a DataTypeMap)

using SampleType = <SSampleCppidt>;

方法文档

函数 Allocate [SWS_CM_90438] Upstream: RS_CM_00201, RS_AP_00114, RS_AP_00115, RS_AP_00120

ara::com::SampleAllocateePtr< SampleType > Allocate ();

Allocating data for event transfer when Communication Management is responsible for the data.

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

当 Communication Management (ara::com) 负责数据管理时 ([SWS_CM_90438]),在 Skeleton 级别为事件调用方法 Allocate ([SWS_CM_90438]; AUTOSAR_AP_EXP_ARAComAPI §5.4.1 “Skeleton Class API’s”),以分配用于传输事件数据的内存。它返回一个类型为 ara::com::SampleAllocateePtr<SampleType> 的实例 ([SWS_CM_90438])。该指针类型在概念上表现得像一个 std::unique_ptr<T>,因此在任何时间点都只有一个参与方拥有该指针的所有权 (ARAComAPI §6 “Event Allocate/Send sample Binding implementer hint”)。

关于错误处理和异常安全性,Allocate 被指定为 not exception safe ([SWS_CM_90438])。规范定义了两种可能的违例(Violations):

  • SampleAllocationViolation:没有足够的内存资源来分配数据 ([SWS_CM_90438])。
  • AllocateUsageViolation:通过用户自定义分配器进行了不允许的分配 ([SWS_CM_90438])。

Allocate 背后的概念主要旨在支持零拷贝机制,特别是在基于共享内存的 IPC 传输中,此时假定读取器和写入器之间存在严格同步 (ARAComAPI §6 “Event Allocate/Send sample Binding implementer hint”)。实现者必须注意,如果部署中的数据类型未配置为二进制兼容,或者识别逻辑排除了这一点,则序列化要求可能会破坏零拷贝 (ARAComAPI §6 “Event Allocate/Send sample Binding implementer hint”)。

在与发送事件的交互中,通过 Allocate 获取的内存指针被传递给 Send(ara::com::SampleAllocateePtr<SampleType> data) ([SWS_CM_90437])。在调用 Send 之后,一旦 Communication Management 将数据发送给所有订阅应用程序,服务应用程序便不得再访问该数据 ([SWS_CM_90437])。

本文由人工智能创建,完全基于 AUTOSAR R25-11 版本的规范文档。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitnot exception safe
Verletzungen (Violations)SampleAllocation- Not enough memory resources can be allocated Violation AllocateUsageVio- The allocation was illegally done via custom allocator lation

Rückgabewert

TypBeschreibung
ara::com::SampleA ara::com::SampleAllocateePtr to an event sample AllocateePtr< Sample Type >

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

Record
AUTOSAR/AP/record/SWS_CM_90438
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_90438@rel:R25-11#5d611e27
Content hash
5d611e27
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_90438
Status: valid/unmigrated Version: rel:R25-11#3059e6d8 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_90438@rel:R25-11#3059e6d8
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b02a325f2026-09-30
  • R19-11rel:R19-11#b404edd72026-10-14
  • R20-11rel:R20-11#8f3783f62026-10-14
  • R21-11rel:R21-11#a234befb2026-10-14
  • R22-11rel:R22-11#340e44dd2026-10-14
  • R23-11rel:R23-11#340e44dd2026-10-14
  • R24-11rel:R24-11#2e4120f42026-10-14
  • R25-11rel:R25-11#3059e6d82026-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

函数 GetSubscriptionState [SWS_CM_12011]

ara::com::SubscriptionState GetSubscriptionState () const noexcept;

Query ara::com::SubscriptionState of an event.

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
ara::com::SubscriptionStateThe state of the subscription (as per [SWS_CM_12008]).

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

Record
AUTOSAR/AP/record/SWS_CM_12011
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12011@rel:R25-11#e9ce27b0
Content hash
e9ce27b0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12011
Status: valid/unmigrated Version: rel:R25-11#dec03137 Versionshistorie & Revisions (1 transition, 4 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_12011@rel:R25-11#dec03137
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#83254be02026-09-30
  • R23-11rel:R23-11#ca04b0b12026-10-14
  • R24-11rel:R24-11#504de02a2026-10-14
  • R25-11rel:R25-11#dec031372026-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

函数 Send [SWS_CM_00162] Upstream: RS_CM_00201, RS_AP_00114, RS_AP_00121

ara::core::Result< void > Send (<SSampleDerivedType> data) noexcept;

Send event where the application is responsible for the data. The Communication Management creates a copy of the data to send and sends it to all subscribing applications.

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

函数 [SWS_CM_00162] 用于在服务提供者端 <SI-Namespace>::skeleton::events::<Event> 内向所有订阅的应用程序发送事件数据。在此变体中,数据分配的责任完全保留在发起调用的应用程序端。数据对象通过参数 data 传入,随后 Binding 实现在调用期间生成一个内部副本(ARAComAPI, Figure 6.17 “BrakeEvent Class”)。在同步方法调用返回后,应用程序可以立即修改或释放原始内存区域。

该方法使用 noexcept 声明并指定为异常安全。它返回一个 ara::core::Result<void>,在成功情况下包含 void,在错误情况下报告来自 [SWS_CM_10432] 的错误代码([SWS_CM_00162]):

  • ComErrc::kServiceNotOffered:当服务实例尚未通过 OfferService() 提供时发生。
  • ComErrc::kMinimumSendIntervalViolationError:当发送请求的发出速度快于配置的最小发送间隔(ServiceInterfaceDeploymentElement.minimumSendInterval)时发生。

与需要通过 Allocate() 获取类型为 ara::com::SampleAllocateePtr 的指针的零拷贝替代方案 [SWS_CM_90437] 相比,此调用不需要将内存绑定到框架。根据 [SWS_CM_00119],相同的传输行为和相同的错误条件也适用于字段的更新方法 Update。

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

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
dataThe data to send out to the subscribed applications.

Rückgabewert

TypBeschreibung
ara::core::Result< void >• If successful: an ara::core::Result containing a ara:: core::Result::value_type containing a void • If unsuccessful: an ara::core::Result containing an ara:: core::Result::error_type i.e. a corresponding ara:: com::ComErrc

Fehler

FehlercodeBeschreibung
ComErrc::kServiceNotOfferedrollback_semantics Service has not yet been offered via OfferService()
ComErrc::kMinimumSendIntervalViolationErrorrollback_semantics Minimum Send Interval violation, because a transmission request for a service instance element (event, field or method call) was issued faster than allowed, i.e., the configured minimum send interval ServiceInterfaceDeploymentElement. minimumSendInterval for the service instance element has not yet expired.

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

Record
AUTOSAR/AP/record/SWS_CM_00162
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_00162@rel:R25-11#0eff24fd
Content hash
0eff24fd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00162
Status: valid/unmigrated Version: rel:R25-11#ba1342ed 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_00162@rel:R25-11#ba1342ed
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#862d13312026-09-30
  • R19-11rel:R19-11#13bfaa4c2026-10-14
  • R20-11rel:R20-11#1f8e5ce62026-10-14
  • R21-11rel:R21-11#dda704792026-10-14
  • R22-11rel:R22-11#d72ec9682026-10-14
  • R23-11rel:R23-11#eda889842026-10-14
  • R24-11rel:R24-11#ec951a632026-10-14
  • R25-11rel:R25-11#ba1342ed2026-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

函数 Send [SWS_CM_90437] Upstream: RS_CM_00201, RS_AP_00114, RS_AP_00121

ara::core::Result< void > Send (ara::com::SampleAllocateePtr< Sample Type > data) noexcept;

Send event where Communication Management is responsible for the data. The data is allocated using Allocate(). The application is not allowed to access the data after Communication Management sends it to all subscribing applications.

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

用法与调用上下文

方法 Send 在服务骨架(<SI-Namespace>::skeleton::events::<Event>)中的事件实例上调用([SWS_CM_90437])。它传输由 Communication Management 负责内存管理的事件数据。类型为 ara::com::SampleAllocateePtr<SampleType> 的参数 data 必须事先通过 Allocate() 获取([SWS_CM_90437])。该指针类型在语义上表现为 std::unique_ptr,从而在调用时将数据的所有权转移给通信层(ARAComAPI §6.17 “BrakeEvent Class”)。移交后,禁止发送方应用程序对数据进行任何进一步访问([SWS_CM_90437])。

错误处理与边界条件

该函数声明为 noexcept 并返回一个 ara::core::Result<void>([SWS_CM_90437])。如果发送失败,结果将包含来自 ara::com::ComErrc 的错误代码([SWS_CM_10432]):

  • ComErrc::kServiceNotOffered:关联的服务事先尚未通过 OfferService() 提供([SWS_CM_90437])。
  • ComErrc::kMinimumSendIntervalViolationError:自上次传输以来,为该服务元素配置的最小发送间隔(minimumSendInterval)尚未过去([SWS_CM_90437])。

这两种错误情况都具有回滚语义([SWS_CM_90437])。因此在调用前必须先提供该服务,且连续的发送调用必须遵守配置的最小间隔。

协作与优化

相较于传入应用程序管理的数据并由 Communication Management 复制的签名 [SWS_CM_00162],此变体旨在通过共享内存实现零拷贝通信(ARAComAPI §6.18 “Event Allocate/Send sample”)。在此前提下,写入者与读取者之间需要严格同步,同时必须注意通信伙伴之间可能存在的序列化要求(ARAComAPI §6.18 “Event Allocate/Send sample”)。

注意:此使用说明基于 R25-11 规范版本自动创建。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
datathe data to send.

Rückgabewert

TypBeschreibung
ara::core::Result< void >• If successful: an ara::core::Result containing a ara:: core::Result::value_type containing a void • If unsuccessful: an ara::core::Result containing an ara:: core::Result::error_type i.e. a corresponding ara:: com::ComErrc

Fehler

FehlercodeBeschreibung
ComErrc::kServiceNotOfferedrollback_semantics Service has not yet been offered via OfferService()
ComErrc::kMinimumSendIntervalViolationErrorrollback_semantics Minimum Send Interval violation, because a transmission request for a service instance element (event, field or method call) was issued faster than allowed, i.e., the configured minimum send interval ServiceInterfaceDeploymentElement. minimumSendInterval for the service instance element has not yet expired.

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

Record
AUTOSAR/AP/record/SWS_CM_90437
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_90437@rel:R25-11#9cc189f7
Content hash
9cc189f7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_90437
Status: valid/unmigrated Version: rel:R25-11#b7d5aba8 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_90437@rel:R25-11#b7d5aba8
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#396a1de42026-09-30
  • R19-11rel:R19-11#943893002026-10-14
  • R20-11rel:R20-11#a05235692026-10-14
  • R21-11rel:R21-11#928b87cd2026-10-14
  • R22-11rel:R22-11#7fc4ccbc2026-10-14
  • R23-11rel:R23-11#7b2bb5e12026-10-14
  • R24-11rel:R24-11#0010eeba2026-10-14
  • R25-11rel:R25-11#b7d5aba82026-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

函数 SetSubscriptionStateChangeHandler [SWS_CM_12008]

void SetSubscriptionStateChangeHandler (ara::com::SubscriptionState ChangeHandler handler) noexcept;

Set/Register ara::com::SubscriptionState change handler

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

使用

函数SetSubscriptionStateChangeHandler在骨架作用域(skeleton::events)中注册一个回调处理程序,以监视事件的订阅状态[SWS_CM_12008]。参数handler必须是符合[SWS_CM_00311]且类型为SubscriptionStateChangeHandler的可调用对象。该方法不返回任何返回值,并被指定为noexcept[SWS_CM_12008]。

一旦事件的订阅状态发生更改,Communication Management 就会调用已注册的处理程序[SWS_CM_12012]。在骨架端,一旦活动订阅数量大于零,就会以状态kSubscribed进行此操作[SWS_CM_12013];当不再存在活动订阅时,则以kNotSubscribed进行此操作[SWS_CM_12014]SWS CommunicationManagement §7.5.4 “Query Service Event Subscription State on Skeleton side”。

错误处理与并发

该操作被归类为exception safe[SWS_CM_12008]。如果传入的 Callable 无效或为 null,则存在InvalidHandlerViolation[SWS_CM_12008]。解释:由于该函数既不抛出异常也不返回错误代码,因此推测该规范违规将通过平台特定的运行时机制被拦截。 问题 Q-a7b7b54f0d538b40 (未决)

允许在运行时覆盖处理程序[SWS_CM_12012]。为了在专用线程或任务上下文中执行,存在带有模板参数executor的重载[SWS_CM_12009]。骨架的触发器元素定义了类似注册[SWS_CM_01110]。

此文本由 AI 基于 AUTOSAR 规范生成。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe
Verletzungen (Violations)InvalidHandlerVio- Provided Callable handler does not exist or is null lation

Parameter (in)

ParameterBeschreibung
handlerThe handler (as per [SWS_CM_00311]) that shall be called by Communication Management as soon as the ara::com:: SubscriptionState of the event has changed.

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_12008
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12008@rel:R25-11#6311c63f
Content hash
6311c63f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12008
Status: valid/unmigrated Version: rel:R25-11#e64cfb4e Versionshistorie & Revisions (1 transition, 4 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_12008@rel:R25-11#e64cfb4e
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#5a03f4292026-09-30
  • R23-11rel:R23-11#d6b69d732026-10-14
  • R24-11rel:R24-11#a914158e2026-10-14
  • R25-11rel:R25-11#e64cfb4e2026-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

函数 SetSubscriptionStateChangeHandler [SWS_CM_12009]

template <typename ExecutorT> void SetSubscriptionStateChangeHandler (ara::com::SubscriptionState ChangeHandler handler, ExecutorT &&executor) noexcept;

As per [SWS_CM_12008] but the method shall execute in a provided context

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

模板函数 SetSubscriptionStateChangeHandler 用于在事件命名空间的 Skeleton 级别([SWS_CM_12009])注册用于接收传入订阅状态变更的回调。与不带 Executor 的基础函数([SWS_CM_12008])相比,它还额外接收一个执行上下文(executor),已注册的处理程序将在该上下文中执行([SWS_CM_12009])。该函数没有返回值,声明为 noexcept 并被视为异常安全([SWS_CM_12009])。

关于错误行为,传入无效或空值 Callable 会导致 InvalidHandlerViolation([SWS_CM_12009])。已注册的处理程序可以在应用程序运行时随时通过再次调用进行覆盖([SWS_CM_12012])。

一旦相应事件的订阅状态发生改变,Communication Management 就会调用该处理程序(SWS CommunicationManagement §7.5.4 “Query Service Event Subscription State on Skeleton side”,[SWS_CM_12012]):

  • 当活跃订阅数从零增加到大于零时,以状态 kSubscribed 进行调用([SWS_CM_12013])。
  • 当活跃订阅者数量再次降至零时,使用 kNotSubscribed 通知处理程序([SWS_CM_12014])。

Interpretation:通过传入 executor,处理程序的执行很可能会被专门绑定到应用程序自身的线程或分发上下文中([SWS_CM_12009]),以便将 Skeleton 代码的并发通知与内部通信线程清晰地分离开来。 问题 Q-b11f3bc97069f2ec (未决)

本文由 AI 生成,基于 R25-11 版本的规范。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe
Verletzungen (Violations)InvalidHandlerVio- Provided Callable handler does not exist or is null lation

Template-Parameter

ParameterBeschreibung
ExecutorTAs per [SWS_CM_11360]

Parameter (in)

ParameterBeschreibung
handlerAs per [SWS_CM_12008]
executorAs per [SWS_CM_11360]

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_12009
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12009@rel:R25-11#da98eee7
Content hash
da98eee7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12009
Status: valid/unmigrated Version: rel:R25-11#2c78e37d Versionshistorie & Revisions (1 transition, 4 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_12009@rel:R25-11#2c78e37d
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#9ab0c0f92026-09-30
  • R23-11rel:R23-11#35fb91a02026-10-14
  • R24-11rel:R24-11#7040342f2026-10-14
  • R25-11rel:R25-11#2c78e37d2026-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

函数 UnsetSubscriptionStateChangeHandler [SWS_CM_12010]

void UnsetSubscriptionStateChangeHandler () noexcept;

Unset/Deregister the ara::com::SubscriptionState change handler

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

函数 UnsetSubscriptionStateChangeHandler 在 Skeleton 级别的命名空间 ::skeleton::events::{<event-name>} 中用于注销先前针对事件的 ara::com::SubscriptionState 注册的状态变更处理程序 [SWS_CM_12010]。该函数不接收传入参数且不返回任何值(void)[SWS_CM_12010]。通过头文件 #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h" [SWS_CM_12010] 引入。

关于异常行为,该方法使用 noexcept 声明并指定为异常安全(exception safe)[SWS_CM_12010]。不返回特定错误代码或抛出 C++ 异常 [SWS_CM_12010]。解读:由于签名未提供错误反馈,注销时的任何内部错误状态大概率由通信管理在内部拦截。 问题 Q-7e986a15e552ca19 (未决)

在与相关接口的协作中,存在用于处理程序注销的类似函数:

本文本由 AI 创建,基于 AUTOSAR Adaptive Release R25-11 规范版本。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_12010
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12010@rel:R25-11#a7e3db34
Content hash
a7e3db34
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12010
Status: valid/unmigrated Version: rel:R25-11#05477f97 Versionshistorie & Revisions (1 transition, 4 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_12010@rel:R25-11#05477f97
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#e1b9df132026-09-30
  • R23-11rel:R23-11#0217aa9b2026-10-14
  • R24-11rel:R24-11#1066f1922026-10-14
  • R25-11rel:R25-11#05477f972026-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

类型别名文档

类型别名 SampleType [SWS_CM_11400] Upstream: RS_CM_00201, RS_AP_00114

using SampleType = <SSampleCppidt>;

Data type for the value of an event sample (the CppImplementationDataType of the Event, i.e. for the CppImplementationDataType which is either referenced by the VariableDataPrototype in the role type directly or via the indirection of a DataTypeMap)

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: events::<Event>
SymbolSampleType

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

Record
AUTOSAR/AP/record/SWS_CM_11400
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11400@rel:R25-11#1c63569a
Content hash
1c63569a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11400
Status: valid/unmigrated Version: rel:R25-11#6376c0a1 Versionshistorie & Revisions (1 transition, 5 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_11400@rel:R25-11#6376c0a1
Point-in-Time History:
Recorded Revisions (5):
  • R25-11rel:R25-11#6078d79a2026-09-30
  • R22-11rel:R22-11#9e7787d62026-10-14
  • R23-11rel:R23-11#9e7787d62026-10-14
  • R24-11rel:R24-11#b98c990b2026-10-14
  • R25-11rel:R25-11#6376c0a12026-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