DEENESPTFRRUARHIKOZHNL

类 <SI-Namespace>::proxy::methods::<Method>

[SWS_CM_00006] Upstream: RS_CM_00212, RS_CM_00213, RS_AP_00114

class <Method> final {...};

Service proxy method class, one for each ClientServerOperation ( ClientServerOperation.fireAndForget ==FALSE) defined in the ServiceInterface in the role method.

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h"
Forwarding-Header#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy/<SiShortname>_proxy_fwd.h"
Scopenamespace <SI-Namespace>::proxy::methods

用户指南人工智能生成

支持带返回值的服务方法的异步调用以及端到端状态检查。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 90f1e995b658 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持带返回值的服务方法的异步调用以及端到端状态检查。

Proxy 方法类 <SI-Namespace>::proxy::methods::<Method> 允许客户端应用程序针对 ServiceInterface 中定义的客户端-服务器操作 [SWS_CM_00196] 执行带返回值的方法调用。调用通过 operator() 以非阻塞方式进行,它会立即返回一个 ara::core::Future,用于灵活地同步或异步查询结果 [SWS_CM_00196]。此外,GetE2EStateMachineState() 允许读取关联端到端状态机的保护状态 [SWS_CM_00148]。由于这些操作被指定为异常安全的,因此传输和运行时错误会通过 Future 并带有标准化错误码进行报告。

上下文

类 <SI-Namespace>::proxy::methods::<Method> 表示 AUTOSAR Adaptive 通信管理内部用于同步和异步方法调用的客户端接口。对于在 ServiceInterface 中声明且配置了属性 ClientServerOperation.fireAndForget == FALSE 的每个客户端-服务器操作,通信框架都会恰好生成一个作为方法角色的专用 Proxy 方法类。该类声明为 final 并通过头文件 #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h" 包含 SWS Communication Management, 第39页。直接交互方包括发起调用的客户端应用程序以及 Network Binding,后者将方法传输转发到远程服务实例并接收其反馈 [SWS_CM_00196]。Proxy 方法接收调用参数并通过 ara::core::Future 对象封装异步流程,客户端通过该对象查询调用的完成情况和结果。

生命周期

<SI-Namespace>::proxy::methods::<Method> 的实例化是与上级服务 Proxy 联合进行的。解释:该方法类作为生成的 Proxy 对象的固定组成部分,应该与其一同实例化和销毁,因此用户无需单独分配该实例。在并发性方面,通过 operator() 进行的方法调用被设计为非阻塞的;该函数启动传输并立即返回给调用者 [SWS_CM_00196]。该实例的一个核心状态是通过端到端机制 (E2E) 进行的保护。通过方法 GetE2EStateMachineState(),应用程序可以确定方法专用状态机 (ara::com::e2e::SMState) 的当前状态 [SWS_CM_00148]。该状态由内部检查函数 E2E_Check() 确定,该函数在处理最后一次 operator() 调用期间执行 [SWS_CM_00148], SWS Communication Management, 第55页。解释:E2E 状态机的状态更新应该在响应消息到达并完成检查时异步生效。 问题 Q-283a9927420e2952 (未决) 问题 Q-546c9b1bceedef6b (未决)

使用路径

典型的调用顺序包括发起方法调用、同步等待结果以及随后的完整性检查:

  1. 触发调用:客户端应用程序通过 operator() 并传入所声明的输入参数来调用函数对象 [SWS_CM_00196], [SWS_CM_00191]。
  2. 立即返回:调用不会阻塞请求线程,而是立即返回一个 ara::core::Future<Output> 类型的对象 [SWS_CM_00196]。
  3. 结果查询:调用者可自主决定是进行同步等待(例如通过 Future 对象)还是异步监控调用的完成 [SWS_CM_00196]。成功完成后,Future 会提供包含响应值的 Output 对象 [SWS_CM_00196], [SWS_CM_99333]。
  4. 检查 E2E 保护状态:调用完成后,应用程序可以通过 GetE2EStateMachineState() 查询 E2E 状态机的状态,以确保数据传输的有效性 [SWS_CM_00148]。
代理方法调用流程Clientmethods::<Method>Future<Output>Server / Bindingoperator()(args)传输方法调用ara::core::Future<Output>Antwortdaten bereitstellenE2E_Check() aktualisiert E2E-Statusget() / Ergebnis abfragenOutput 或错误GetE2EStateMachineState()ara::com::e2e::SMState

时序图:带 Future 异步返回以及后续 E2E 状态查询的方法调用的典型流程。来源:[SWS_CM_00196], [SWS_CM_00148]。

错误场景

操作 operator() 和 GetE2EStateMachineState() 被指定为异常安全的 (exception safe) 并使用 noexcept 声明 [SWS_CM_00148], [SWS_CM_00196]。因此,通信和提供错误不会通过 C++ 异常报告,而是通过生成的 ara::core::Future 对象传递,该对象在发生错误时会封装相应的 ara::core::FutureErrc 或错误码 [SWS_CM_00196]。指定的错误原因包括:

  • CommunicationFailure:Network Binding 报告可恢复的通信错误或安全连接失败;在通信超时的情况下,这可能导致远程服务器处于不确定状态 [SWS_CM_00196]。
  • ComErrc::kServiceNotAvailable:服务实例在先前提供后不再可达 [SWS_CM_00196]。
  • ComErrc::kUnknownApplicationError:远程服务报告了未配置的应用程序错误 [SWS_CM_00196]。
  • ComE2EErrc::kUnspecifiedE2EError:远程服务报告了未指定的端到端错误 [SWS_CM_00196]。
  • ComErrc::kMinimumSendIntervalViolationError:调用请求的速度快于为接口元素配置的最小发送间隔 minimumSendInterval 所允许的速度 [SWS_CM_00196]。
  • 权限冲突 (InsufficientPermissionsViolation):如果调用者缺少必需的权限,Grant Enforcement 将拒绝执行 [SWS_CM_00196]。

根据规范,为这些应用程序和通信错误定义了回滚语义 (rollback_semantics) [SWS_CM_00196]。

本指南仅基于 AUTOSAR Adaptive Release R25-11 的规范要求。

成员图

运算符

1

嵌套类型

1

类图

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

G n_SI_Namespace___proxy__methods___Method_320 <Method> + GetE2EStateMachineState() + operator()

详细视图

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

方法

Returns the state of the specific method class, which was determined by the last run of E2E_Check() function invoked during the last call of operator()

ara::com::e2e::SMState GetE2EStateMachineState () const noexcept;

运算符

operator 函数

Initiate a method call (ClientServerOperation. fireAndForget ==FALSE). The method call will return immediately. The caller’s selection of a synchronous or asynchronous behavior to get the method output is achieved by the use of the returned ara::core::Future object which is used to query for method completion and result including possible error.

ara::core::Future< Output > operator() ( {<p-method-in-arg-derived-type-0toN>} {<p-method-in-arg-symbol-0toN>}) noexcept;

嵌套类型

Output 类

方法文档

函数 GetE2EStateMachineState [SWS_CM_00148] Upstream: RS_CM_00224, RS_E2E_08534

ara::com::e2e::SMState GetE2EStateMachineState () const noexcept;

Returns the state of the specific method class, which was determined by the last run of E2E_Check() function invoked during the last call of operator()

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h"
Scopeclass <SI-Namespace>::proxy::methods::<Method>
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
ara::com::e2e::SMStateState of the specific method class

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

Record
AUTOSAR/AP/record/SWS_CM_00148
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_00148@rel:R25-11#164d70bd
Content hash
164d70bd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00148
Status: valid/unmigrated Version: rel:R25-11#6f69a7c8 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_00148@rel:R25-11#6f69a7c8
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 [SWS_CM_00196] Upstream: RS_CM_00212, RS_CM_00213, RS_AP_00114, RS_AP_00120, RS_AP_00127, RS_AP_00128, RS_AP_00138

ara::core::Future< Output > operator() ( {<p-method-in-arg-derived-type-0toN>} {<p-method-in-arg-symbol-0toN>}) noexcept;

Initiate a method call (ClientServerOperation. fireAndForget ==FALSE). The method call will return immediately. The caller’s selection of a synchronous or asynchronous behavior to get the method output is achieved by the use of the returned ara::core::Future object which is used to query for method completion and result including possible error.

Header-Datei#include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h"
Scopeclass <SI-Namespace>::proxy::methods::<Method>
Exception-Sicherheitexception safe ComErrc::k no_rollback_semantics
Verletzungen (Violations)InsufficientPer- Refused by Grant Enforcement missionsViolation

Parameter (in)

ParameterBeschreibung
{<p-method-in-arg-symbol-0toN>}As per {<p-method-in-arg-symbol-0toN>} in [SWS_CM_00191]

Rückgabewert

TypBeschreibung
ara::core::Future<Output >• If successful: an ara::core::Future containing a Output object as per [SWS_CM_99333] • If unsuccessful: an ara::core::Future containing a corresponding ara::core::FutureErrc

Fehler

FehlercodeBeschreibung
CommunicationFailureThe network binding reported a recoverable communications error or a secure communication failure. In case of a communication timeout this could lead to an uncertain state on the remote server side.
ComErrc::kUnknownApplicationErrorrollback_semantics A remote service returned an unconfigured application error.
ComErrc::kServiceNotAvailablerollback_semantics Service is not available after being previously offered via Offer Service()
ComE2EErrc::kUnspecifiedE2EErrorrollback_semantics A remote service returned an unspecified E2E error.
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_00196
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_00196@rel:R25-11#1bf2bb36
Content hash
1bf2bb36
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00196
Status: valid/unmigrated Version: rel:R25-11#52e964c2 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_00196@rel:R25-11#52e964c2
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#9ff3657d2026-09-30
  • R19-11rel:R19-11#f1ab8f5a2026-10-14
  • R20-11rel:R20-11#371fca132026-10-14
  • R21-11rel:R21-11#3b7e8fe92026-10-14
  • R22-11rel:R22-11#83f6c51d2026-10-14
  • R23-11rel:R23-11#354539802026-10-14
  • R24-11rel:R24-11#666c03b72026-10-14
  • R25-11rel:R25-11#52e964c22026-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