DEENESPTFRRUARHIKOZHNL

结构体 ara::com::FindServiceHandle

[SWS_CM_00303] Upstream: RS_CM_00102

struct FindServiceHandle {...};

The exact definition of ara::com::FindServiceHandle is Communication Management implementation specific. ara::com::FindServiceHandle satisfies the [equalitycomparable] and [lessthancomparable] requirements as per [30] to allow storing and managing ara::com::FindServiceHandles by the application.

Literaturverzeichnis SWS CommunicationManagement: [30] ISO/IEC 14882:2014, Information technology – Programming languages – C++ – www.iso.org

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

用户指南人工智能生成

用作控制令牌,用于管理和终止正在进行的异步后台服务实例搜索。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: eb9ee1985b4b 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用作控制令牌,用于管理和终止正在进行的异步后台服务实例搜索。

结构体 ara::com::FindServiceHandle 用作唯一控制令牌,以控制在后台运行的服务监控 (AUTOSAR_AP_EXP_ARAComAPI 第34页)。由于默认构造函数已被删除 ([SWS_CM_00353]),该 Handle 仅由 StartFindService 创建,并在接收到异步状态回调后允许通过 StopFindService 定向终止搜索 (AUTOSAR_AP_EXP_ARAComAPI 第30页)。支持的比较运算符还确保了可以在标准容器中对多个搜索请求进行可存储的管理 ([SWS_CM_11526], [SWS_CM_11527])。

上下文

结构体 ara::com::FindServiceHandle 在 Adaptive Platform 的模块 com 中用作异步连续服务搜索的唯一标识符和控制令牌。通过 FindService 进行的同步查询是一次性确定匹配的服务实例并直接返回 Handle 容器,而 StartFindService 则在后台启动对服务可用性的持久监控 (AUTOSAR_AP_EXP_ARAComAPI 第34页)。该过程通常涉及应用程序实例、类型特定的 Proxy 类(例如 RadarServiceProxy)以及 FindServiceHandler 类型的用户自定义回调函数 (AUTOSAR_AP_EXP_ARAComAPI 第30页)。ara::com::FindServiceHandle 的具体内部表示针对各 Communication Management 进行实现特定的设计,但为操作提供了标准化的 C++ 接口。

生命周期

ara::com::FindServiceHandle 的生命周期与 Communication Management 中的活动搜索过程紧密绑定:

  • 创建:默认构造函数已被显式删除 ([SWS_CM_00353])。因此,应用程序无法创建未初始化或随意的 Handle 实例。相反,有效的 Handle 仅作为 ara::core::Result 的有效负载由静态方法 StartFindService 生成 (AUTOSAR_AP_EXP_ARAComAPI 第30页)。
  • 管理与所有权:Handle 支持通过拷贝赋值运算符 [SWS_CM_11528] 进行赋值。为了允许应用程序在标准容器(如有序集合或关联容器)中存储和组织多个搜索请求,该类型通过运算符 operator== ([SWS_CM_11526]) 和 operator< ([SWS_CM_11527]) 满足 C++ 概念 [equalitycomparable] 和 [lessthancomparable]。
  • 终止与销毁:只要后台监控处于活动状态,Handle 就保持有效。通过将 Handle 传递给 StopFindService 来终止搜索 (AUTOSAR_AP_EXP_ARAComAPI 第30页, AUTOSAR_AP_EXP_ARAComAPI 第34页)。在此调用之后,Handle 不再表示正在运行的搜索过程。

使用路径

常规流程包括注册搜索请求、持续接收可用性更新以及有序停止监控过程:

  1. 启动搜索:应用程序通过 StartFindService 注册一个 FindServiceHandler,以接收关于新可用或失效服务实例的通知 (AUTOSAR_AP_EXP_ARAComAPI 第30页, AUTOSAR_AP_EXP_ARAComAPI 第34页)。
  2. 获取 Handle:成功启动后,该调用返回包含 FindServiceHandle 的 ara::core::Result (AUTOSAR_AP_EXP_ARAComAPI 第30页),应用程序将其保存以供后续控制调用使用。
  3. 异步通知:Communication Management 执行后台搜索,并在状态发生更改时调用所提供的处理程序 (AUTOSAR_AP_EXP_ARAComAPI 第34页)。
  4. 停止搜索:一旦找到实例或不再需要监控,应用程序就会将 Handle 传递给 StopFindService (AUTOSAR_AP_EXP_ARAComAPI 第30页, AUTOSAR_AP_EXP_ARAComAPI 第34页)。
使用 FindServiceHandle 进行异步服务搜索的流程ApplikationProxyFindServiceHandlerStartFindService(handler)Result<FindServiceHandle>Use Case: 后台监控激活关于实例的通知Use Case: 终止监控StopFindService(handle)

时序图:从注册、通知到通过 FindServiceHandle 终止的异步服务搜索典型流程。来源:AUTOSAR_AP_EXP_ARAComAPI 第30页, AUTOSAR_AP_EXP_ARAComAPI 第34页。

错误场景

在使用 ara::com::FindServiceHandle 时,需注意以下系统特定边界条件:

本指南基于 Adaptive Platform (Release R25-11) 的 AUTOSAR 规范。所展示的接口和行为基于引用的 SWS 需求和 API 描述。

成员图

构造函数和析构函数

1

类图

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

G nara__com__FindServiceHandle138 «struct» FindServiceHandle + FindServiceHandle() + operator=() + operator<() + operator==()

详细视图

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

构造函数和析构函数

Default constructor deletion

FindServiceHandle ()=delete;

运算符

operator< 函数

LessThan operator as per [lessthancomparable] in [30]

bool operator< (const FindServiceHandle &other) const;
operator= 函数

Copy assignment constructor

FindServiceHandle & operator= (const FindServiceHandle &other);
operator== 函数

Equality operator as per [equalitycomparable] in [30]

bool operator== (const FindServiceHandle &other) const;

方法文档

函数 FindServiceHandle [SWS_CM_00353] Upstream: RS_AP_00146

FindServiceHandle ()=delete;

Default constructor deletion

Header-Datei#include "ara/com/service/find_service_handle.h"
Scopestruct ara::com::FindServiceHandle

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

Record
AUTOSAR/AP/record/SWS_CM_00353
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_00353@rel:R25-11#38de81b2
Content hash
38de81b2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00353
Status: valid/unmigrated Version: rel:R25-11#8a450052 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_00353@rel:R25-11#8a450052
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#b1f430d12026-09-30
  • R23-11rel:R23-11#604163032026-10-14
  • R24-11rel:R24-11#8a4500522026-10-14
  • R25-11rel:R25-11#8a4500522026-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_11527]

bool operator< (const FindServiceHandle &other) const;

LessThan operator as per [lessthancomparable] in [30]

Literaturverzeichnis SWS CommunicationManagement: [30] ISO/IEC 14882:2014, Information technology – Programming languages – C++ – www.iso.org

Header-Datei#include "ara/com/service/find_service_handle.h"
Scopestruct ara::com::FindServiceHandle
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherOther ara::com::FindServiceHandle to compare

Rückgabewert

TypBeschreibung
boolTRUE if other is less than *this, FALSE otherwise.

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

Record
AUTOSAR/AP/record/SWS_CM_11527
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11527@rel:R25-11#5f1bd902
Content hash
5f1bd902
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11527
Status: valid/unmigrated Version: rel:R25-11#b1ec1ec0 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_11527@rel:R25-11#b1ec1ec0
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#9b3fc18e2026-09-30
  • R24-11rel:R24-11#2bb55cbe2026-10-14
  • R25-11rel:R25-11#b1ec1ec02026-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_11528]

FindServiceHandle & operator= (const FindServiceHandle &other);

Copy assignment constructor

Header-Datei#include "ara/com/service/find_service_handle.h"
Scopestruct ara::com::FindServiceHandle
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherOther ara::com::FindServiceHandle to copy

Rückgabewert

TypBeschreibung
FindServiceHandle &New ara::com::FindServiceHandle

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

Record
AUTOSAR/AP/record/SWS_CM_11528
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11528@rel:R25-11#ccc7a9b3
Content hash
ccc7a9b3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11528
Status: valid/unmigrated Version: rel:R25-11#847556b4 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_11528@rel:R25-11#847556b4
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#414d7a6c2026-09-30
  • R24-11rel:R24-11#f73bf3482026-10-14
  • R25-11rel:R25-11#847556b42026-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_11526]

bool operator== (const FindServiceHandle &other) const;

Equality operator as per [equalitycomparable] in [30]

Literaturverzeichnis SWS CommunicationManagement: [30] ISO/IEC 14882:2014, Information technology – Programming languages – C++ – www.iso.org

Header-Datei#include "ara/com/service/find_service_handle.h"
Scopestruct ara::com::FindServiceHandle
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherOther ara::com::FindServiceHandle to compare

Rückgabewert

TypBeschreibung
boolTRUE if other is equal to *this, FALSE otherwise.

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

Record
AUTOSAR/AP/record/SWS_CM_11526
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11526@rel:R25-11#6ca49b89
Content hash
6ca49b89
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11526
Status: valid/unmigrated Version: rel:R25-11#d2ea98ee 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_11526@rel:R25-11#d2ea98ee
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#d9c8643c2026-09-30
  • R24-11rel:R24-11#491d93d72026-10-14
  • R25-11rel:R25-11#d2ea98ee2026-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