DEENESPTFRRUARHIKOZHNL

类 <SI-Namespace>::skeleton::triggers::<Trigger>

[SWS_CM_00726] Upstream: RS_CM_00201, RS_AP_00114

class <Trigger> {...};

Service skeleton Trigger class, one for each Trigger defined in the ServiceInterface in the role trigger.

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Forwarding-Header#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton/<SiShortname>_skeleton_fwd.h"
Scopenamespace <SI-Namespace>::skeleton::triggers

用户指南人工智能生成

使服务 Skeleton 能够发送触发信号并监控订阅者状态。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6e97d3082aff 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使服务 Skeleton 能够发送触发信号并监控订阅者状态。

类 <SI-Namespace>::skeleton::triggers::<Trigger> 使服务器应用程序能够通过 Communication Management([SWS_CM_00721])向订阅 Client 发送触发信号。为了进行流程控制,可以监控订阅者状态并注册通知处理程序([SWS_CM_01109],[SWS_CM_01110])。通过 Send() 触发需要已提供的服务 Skeleton,并针对违反最小发送间隔或网络错误的情况通过相应的错误代码进行确认([SWS_CM_00721],[SWS_CM_10517])。

上下文

模板类 <SI-Namespace>::skeleton::triggers::<Trigger> 表示在 ServiceInterface 内以 trigger 角色定义的触发器的服务端接口。作为服务骨架(Skeleton)的组成部分,该类用于服务实例向整个系统中的订阅 Client 应用程序发送异步通知或触发信号。触发器与常规事件的区别在于,它主要充当没有复杂有效负载的纯信号指示事件,如 EXP_ARAComAPI §3 “Trigger::Send” 和 SWS_CommunicationManagement §7.2.2.1.4 “Handling Triggers” 中的归类所述。交互伙伴包括提供服务的服务器应用程序、中间件 Communication Management(ara::com)以及通过网络连接的 Subscriber Client。

生命周期

触发器对象的实例化通常作为相应 ServiceInterface 的 Skeleton 实例的组成部分执行。在主动使用之前,必须通过 Communication Management 提供 Skeleton;如果尝试在此之前触发 Trigger,则传输将失败([SWS_CM_00721])。该类通过 ara::com::SubscriptionState 管理订阅者的订阅状态,该状态可随时通过 GetSubscriptionState() 查询([SWS_CM_01109])。为了进行异步状态监控,可以通过 SetSubscriptionStateChangeHandler() 注册回调([SWS_CM_01110])。对于并发架构,存在一个接受用户定义的 Executor 的重载,以便在所需的线程或任务上下文中执行通知([SWS_CM_01111])。可以通过 UnsetSubscriptionStateChangeHandler() 再次取消注册([SWS_CM_01112])。该类的所有方法均提供异常安全保证 noexcept(exception safe)。

使用路径

使用触发器的典型流程包括观察订阅状态以及实际向所有活动订阅者触发传输:

  • 处理程序注册:服务应用程序可选地通过 SetSubscriptionStateChangeHandler() 注册状态处理程序([SWS_CM_01110],[SWS_CM_01111]),以便获知新加入的订阅者。
  • 状态检查:服务器使用 GetSubscriptionState() 检查是否存在至少一个活动的 Subscriber([SWS_CM_01109]),根据 [SWS_CM_10518],这是发送请求的前提条件。
  • 发送触发器:发送通过调用 Send() 发起([SWS_CM_00721],EXP_ARAComAPI §3 “Trigger::Send”),随后 Communication Management 将信号分发给所有已订阅的应用程序。
  • 注销:在关机时或不再需要状态通知时,调用 UnsetSubscriptionStateChangeHandler()([SWS_CM_01112])。
服务骨架处的触发信号发送流程Server-AppTrigger-Instanzara::comSetSubscriptionStateChangeHandler(handler)voidUse Case: 客户端更改订阅handler(kSubscribed)GetSubscriptionState()kSubscribedUse Case: Trigger sendenSend()Sende Trigger-SignalResult<void>

时序图:带有订阅监控的触发器传输典型流程。来源:[SWS_CM_01110],[SWS_CM_01109],[SWS_CM_00721],SWS_CommunicationManagement §7.2.2.1.4。

错误场景

方法 Send() 返回一个 ara::core::Result<void>,可能的传输和配置错误将通过它进行传递([SWS_CM_00721]):

  • ComErrc::kServiceNotOffered:当服务实例尚未通过 OfferService() 提供时发生([SWS_CM_00721])。
  • ComErrc::kMinimumSendIntervalViolationError:如果在连续传输之间低于配置的最小发送间隔(minimumSendInterval),则返回此项([SWS_CM_00721])。
  • ComErrc::kCommunicationFailure:如果触发器的发送由于底层网络错误而在本地失败,则报告此项([SWS_CM_10517])。
  • 无效的处理程序(InvalidHandlerViolation):向 SetSubscriptionStateChangeHandler() 传递不存在或空的可调用对象(Callable)构成对 API 契约条件的违反([SWS_CM_01110],[SWS_CM_01111])。

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

成员图

类图

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

G n_SI_Namespace___skeleton__triggers___Trigger_907 <Trigger> + Send() + SetSubscriptionStateChangeHandler() + GetSubscriptionState() + UnsetSubscriptionStateChangeHandler()

详细视图

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

方法

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

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

Send trigger to all subscribing applications.

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

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

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

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

void UnsetSubscriptionStateChangeHandler () noexcept;

方法文档

函数 GetSubscriptionState [SWS_CM_01109] Upstream: RS_CM_00106

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

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: triggers::<Trigger>
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_01109
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_01109@rel:R25-11#bed949f8
Content hash
bed949f8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_01109
Status: valid/unmigrated Version: rel:R25-11#3c94b170 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CM_01109@rel:R25-11#3c94b170
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

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

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

Send trigger to all subscribing applications.

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

方法 Send 向所有订阅的应用程序传输不带有效负载的触发器([SWS_CM_00721])。它属于 Skeleton 类 <SI-Namespace>::skeleton::triggers::<Trigger>,并通过头文件 #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h" 提供([SWS_CM_00721])。

该函数被定义为 noexcept,视为异常安全,且不需要输入参数([SWS_CM_00721])。返回类型为 ara::core::Result<void>([SWS_CM_00721]):

  • 成功情况:结果包含一个空值(void),并指示传输已成功触发([SWS_CM_00721])。
  • 错误情况:结果封装了来自领域 ara::com::ComErrc 的错误代码([SWS_CM_10432])。具有回滚语义的可能错误包括:
    • ComErrc::kServiceNotOffered:服务此前尚未通过 OfferService() 提供([SWS_CM_00721])。
    • ComErrc::kMinimumSendIntervalViolationError:在配置的最小发送间隔 ServiceInterfaceDeploymentElement.minimumSendInterval 到期之前发出了传输请求([SWS_CM_00721])。

关于并发性和可重入性,参考资料未作说明;大概需要在应用层对同一实例上的并发调用进行同步。 问题 Q-ff3beeb7bad5dd32 (未决)与通过 Event::Send 进行的基于事件的数据传输([SWS_CM_00162]、[SWS_CM_90437]、AUTOSAR_AP_EXP_ARAComAPI 第10页)或通过 Update 进行的字段更新([SWS_CM_00119])不同,根据 [SWS_CM_00721](AUTOSAR_AP_EXP_ARAComAPI 第10页),Trigger::Send 不传输任何有效负载,而是作为纯粹的触发脉冲。

本文由 AI 基于 AUTOSAR 规范 R25-11 生成。

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

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

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_00721
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_00721@rel:R25-11#f44785fa
Content hash
f44785fa
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00721
Status: valid/unmigrated Version: rel:R25-11#358a03ec Versionshistorie & Revisions (1 transition, 6 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_00721@rel:R25-11#358a03ec
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#3ca0ef032026-09-30
  • R21-11rel:R21-11#28e321132026-10-14
  • R22-11rel:R22-11#9e3dfc132026-10-14
  • R23-11rel:R23-11#11d16c2d2026-10-14
  • R24-11rel:R24-11#7198da332026-10-14
  • R25-11rel:R25-11#358a03ec2026-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_01110] Upstream: RS_CM_00106

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

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

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

函数SetSubscriptionStateChangeHandler在骨架端用于注册一个回调函数,以监视触发器上的订阅更改[SWS_CM_01110]。该方法属于命名空间<SI-Namespace>::skeleton::triggers::<Trigger>,并通过头文件<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h提供[SWS_CM_01110]。

传递一个类型为SubscriptionStateChangeHandler的可调用函数对象作为参数[SWS_CM_00311][SWS_CM_01110]。该调用被声明为noexcept,不返回任何返回值,并被指定为异常安全(exception safe)[SWS_CM_01110]。如果传入的处理程序 Callable 不存在或为 null,系统将报告一个InvalidHandlerViolation[SWS_CM_01110]。

一旦触发器的订阅状态发生更改,Communication Management 就会调用已注册的回调函数[SWS_CM_01101]:

  • 一旦该触发器的活动订阅数大于 0,则带有状态值kSubscribed[SWS_CM_01102],
  • 当不再存在活动订阅时,在骨架端带有状态值kNotSubscribed[SWS_CM_01103]。

已注册的处理程序允许在运行时被覆盖[SWS_CM_01101]。如果处理程序的执行应在定义的执行上下文中进行,则还可以选择带有ExecutorT&&参数的重载模板变体[SWS_CM_01111]。

本文由 AI 基于 AUTOSAR 规范 R25-11 生成。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: triggers::<Trigger>
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 trigger 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_01110
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_01110@rel:R25-11#188ea03b
Content hash
188ea03b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_01110
Status: valid/unmigrated Version: rel:R25-11#c6e0fca1 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CM_01110@rel:R25-11#c6e0fca1
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

函数 SetSubscriptionStateChangeHandler [SWS_CM_01111] Upstream: RS_CM_00106

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

模板函数 SetSubscriptionStateChangeHandler 在Skeleton层级为Trigger([SWS_CM_01111])注册订阅状态变更的回调处理程序(ara::com::SubscriptionState)。除可调用参数 handler 外,该方法还接受类型为 ExecutorT 的执行上下文 executor([SWS_CM_01111])。该函数没有返回值,并在作用域 <SI-Namespace>::skeleton::triggers::<Trigger> 中定义([SWS_CM_01111])。

与不带执行器的基础函数([SWS_CM_01110])相比,此签名确保回调在用户定义的上下文中执行([SWS_CM_01111])。与基于 [SWS_CM_12008] 的事件驱动变体类似,执行推测将委托给传入的执行器对象,以便在Skeleton应用程序中有针对性地控制线程处理。 问题 Q-ba14993b00a7d972 (未决)

该接口被指定为 noexcept 且异常安全([SWS_CM_01111])。根据规范,如果传入的Callable无效或为空,则属于 InvalidHandlerViolation([SWS_CM_01111])。

在功能上,该方法与Skeleton Event对应的执行器重载([SWS_CM_12009])以及Proxy接口的客户端对应项([SWS_CM_01106],[SWS_CM_11354])相吻合。

此使用说明基于AUTOSAR Adaptive R25-11的规范数据自动生成。

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: triggers::<Trigger>
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_01111
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_01111@rel:R25-11#d18e32ad
Content hash
d18e32ad
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_01111
Status: valid/unmigrated Version: rel:R25-11#fc3a9545 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CM_01111@rel:R25-11#fc3a9545
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

函数 UnsetSubscriptionStateChangeHandler [SWS_CM_01112] Upstream: RS_CM_00106

void UnsetSubscriptionStateChangeHandler () noexcept;

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

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

函数 UnsetSubscriptionStateChangeHandler 在 Skeleton 端用于移除先前为服务触发器上的订阅状态变更(SubscriptionState)注册的回调([SWS_CM_01112])。它在命名空间 <SI-Namespace>::skeleton::triggers::<Trigger> 中通过头文件 <SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h 定义([SWS_CM_01112])。

用法与语义:该接口具有签名 void UnsetSubscriptionStateChangeHandler() noexcept,不期望任何传入参数,且没有返回值([SWS_CM_01112])。根据规范,它被归类为异常安全(exception safe)([SWS_CM_01112])。此调用未预设错误代码或特定的报告机制(DET/DEM)。

协作与生命周期:一旦相应触发器的订阅状态发生改变,通过 [SWS_CM_01112] 移除的回调就会由 Communication Management 调用([SWS_CM_01101]、AUTOSAR_AP_SWS_CommunicationManagement §7.5.15 “Query Service Trigger Subscription State on Skeleton side”)。例如,当活动订阅数量大于零时,以状态 kSubscribed 发生([SWS_CM_01102]),或以 kNotSubscribed 发生([SWS_CM_01103])。该处理程序允许在运行时被覆盖([SWS_CM_01101]);调用 UnsetSubscriptionStateChangeHandler 将取消该注册。

并发性与相关接口:关于并发性,注销应同步进行,从而在函数调用返回后不再向先前注册的处理程序传递任何进一步的状态通知。 问题 Q-e005c4818e02e52f (未决)类似的注销函数在 Skeleton 端针对事件([SWS_CM_12010])以及在 Proxy 端针对事件([SWS_CM_00334])、触发器([SWS_CM_01108])和字段([SWS_CM_11609]、AUTOSAR_AP_EXP_ARAComAPI §5.3.1 “Proxy Class API’s”)进行了规范。

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

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

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h"
Scopeclass <SI-Namespace>::skeleton:: triggers::<Trigger>
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_01112
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_01112@rel:R25-11#9972fff0
Content hash
9972fff0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_01112
Status: valid/unmigrated Version: rel:R25-11#19334e8a Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CM_01112@rel:R25-11#19334e8a
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