DEENESPTFRRUARHIKOZHNL

类 ara::com::ServiceVersionType

[SWS_CM_11515] Upstream: RS_CM_00200, RS_CM_00500

class ServiceVersionType {...};

Specifies a Service Version. The exact type may be overridden by the Communication Management software provider. but shall at least satisfy the [equalitycomparable] ([SWS_CM_11516]), [lessthancomparable] ([SWS_CM_11517]) and [copyassignable] ([SWS_CM_11518]) requirements as per [30] to allow for logging, storing and managing ara:: com::ServiceVersionTypes 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/service_version.h"
Forwarding-Header#include "ara/com/com_fwd.h"
Scopenamespace ara::com

用户指南人工智能生成

用于在应用程序中表示、记录和比较管理服务版本。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: abf1d9197db7 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用于在应用程序中表示、记录和比较管理服务版本。

类 ara::com::ServiceVersionType 用于在 AUTOSAR Adaptive Platform 中对服务版本进行标准化表示和管理([SWS_CM_11515])。应用程序利用这些实例通过相等性比较和顺序比较进行兼容性检查、存入容器中以及通过 ToString() 进行记录([SWS_CM_11519])。具体类型允许由 Communication Management 提供商进行重写,但必须满足基本的 C++ 比较和赋值要求。在使用时应注意,该类的所有成员函数在规范上均被归类为非异常安全。

上下文

类 ara::com::ServiceVersionType 在头文件 ara/com/service/service_version.h(AUTOSAR_AP_SWS_CommunicationManagement §8.11 “Header: ara/com/service/service_version.h”)中定义了通信服务的版本([SWS_CM_11515])。其主要职责是使应用软件能够处理服务版本,从而使其能够存储、管理、比较和记录版本信息([SWS_CM_11515])。

该平台的一个架构特性在于其灵活性:根据 [SWS_CM_11515],具体的内部数据类型可由 Communication Management 的软件提供商重写或扩展。为了依然确保在可移植应用中的一致处理,规范要求该类型至少满足符合 ISO/IEC 14882:2014 的 C++ 标准概念 [equalitycomparable]([SWS_CM_11516])、[lessthancomparable]([SWS_CM_11517])和 [copyassignable]([SWS_CM_11518])。

除了 Communication Management 软件提供商之外,交互伙伴还包括将版本作为静态常量 serviceVersion 提供的服务接口(AUTOSAR_AP_SWS_CommunicationManagement 第320页),以及执行版本比对的应用软件。

diag_serviceversion_kontext provider Communication Management Software Provider service_version ara::com::ServiceVersionType provider->service_version 定义 / 覆盖 service_interface Service-Schnittstelle (serviceVersion) service_interface->service_version exponiert application Anwendungssoftware (Application) application->service_interface liest Version application->service_version speichert, vergleicht, protokolliert

上下文图:ara::com::ServiceVersionType 在软件提供商、服务接口与应用程序之间的嵌入。来源:[SWS_CM_11515]、AUTOSAR_AP_SWS_CommunicationManagement 第320页、AUTOSAR_AP_SWS_CommunicationManagement §8.11.1 “Class: ServiceVersionType”。

生命周期

ara::com::ServiceVersionType 的实例被设计为常规值类型(Value Types)。创建与值接收通过复制和赋值进行:通过赋值运算符 operator= 满足了要求 [copyassignable]([SWS_CM_11518]),从而使实例能够接收新值。

在所有权关系方面,ara::com::ServiceVersionType 属于相应调用方的作用域,或作为服务定义的常量保留(AUTOSAR_AP_SWS_CommunicationManagement 第320页)。该类型不包含复杂的内部状态机,而是封装了离散的版本值。其销毁在离开作用域时自动发生。

关于并发性,读取操作 operator==([SWS_CM_11516])、operator<([SWS_CM_11517])和 ToString([SWS_CM_11519])被声明为 const。解释:来自多个线程对同一实例的同时读取访问在没有同步的情况下推测是安全的,而并行写入和赋值过程必须受到外部保护。 问题 Q-9582ce9a82b9b833 (未决)

使用路径

在应用程序中使用 ara::com::ServiceVersionType 的典型流程分为以下步骤:

  1. 版本查询:应用程序访问服务的版本信息,例如通过接口的静态常量 serviceVersion(AUTOSAR_AP_SWS_CommunicationManagement 第320页)。
  2. 兼容性检查:应用程序通过 operator== 将版本与预期版本进行比较([SWS_CM_11516])。对于顺序检查或在已排序标准容器中的存放,使用 operator<([SWS_CM_11517])。
  3. 管理与存储:为了传递或本地存储版本状态,应用程序使用赋值运算符 operator=([SWS_CM_11518])。
  4. 记录:对于诊断消息或日志输出,应用程序通过方法 ToString() 生成作为 ara::core::StringView 的文本表示([SWS_CM_11519]、AUTOSAR_AP_SWS_CommunicationManagement §8.11.1.1.2.1 “ToString”)。

错误场景

使用该接口时必须注意特定的边界条件:

  • 异常安全性:所有已规范的函数——operator=([SWS_CM_11518])、operator==([SWS_CM_11516])、operator<([SWS_CM_11517])和 ToString([SWS_CM_11519])——在规范中均被明确声明为 not exception safe。在发生错误时(例如在特定于提供商的实现中发生内存分配时),应用程序不得依赖自动恢复保证。
  • 字符串视图的有效性:方法 ToString() 返回一个 ara::core::StringView([SWS_CM_11519])。解释:由于 StringView 不管理自己的内存,被引用的字符串的生命周期推测绑定到底层实例或静态内存;超出数据源有效性的使用将导致未定义行为。 问题 Q-fdb6e821db46af00 (未决)

本指南基于 AUTOSAR 标准 Release R25-11,并仅考虑来自 AUTOSAR_AP_SWS_CommunicationManagement 的要求。

成员图

类图

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

G nara__com__ServiceVersionType743 ServiceVersionType + operator=() + ToString() + operator<() + operator==()

详细视图

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

方法

ToString 函数

Stringification method for ara::com::ServiceVersionType

ara::core::StringView ToString () const;

运算符

operator< 函数

LessThan operator as per [lessthancomparable] in [30]

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

Copy assignment constructor

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

Equality operator as per [equalitycomparable] in [30]

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

方法文档

函数 ToString [SWS_CM_11519] Upstream: RS_CM_00200, RS_CM_00500

ara::core::StringView ToString () const;

Stringification method for ara::com::ServiceVersionType

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

类 ara::com::ServiceVersionType 的同步成员函数 ToString 用于将版本信息序列化并作为可读字符串表示形式提供([SWS_CM_11519],SWS CommunicationManagement §8.11.1.1.2.1 “ToString”)。它在头文件 #include "ara/com/service/service_version.h" 中声明,作为 const 方法不接收任何参数,并返回指向服务版本字符串表示的 ara::core::StringView([SWS_CM_11519])。

根据 [SWS_CM_99029],映射的版本信息派生自各个 ServiceInterface 的属性 majorVersion 和 minorVersion(SWS CommunicationManagement §7.5.22.1 “Service Identifier Data Types”)。根据 [SWS_CM_00088],字符串的具体格式由厂商针对 Communication Management 专门定义,并未在整个 AUTOSAR 范围内标准化(SWS CommunicationManagement §7.5.22.1 “Service Identifier Data Types”)。

对于使用和并发性,适用以下边界条件:

  • 异常安全性:该函数在规范中被明确归类为非异常安全(not exception safe)([SWS_CM_11519])。未定义特定的错误代码或向 DET 或 DEM 的报告。
  • 返回值的生命周期:由于返回的是 ara::core::StringView,所引用的缓冲区推测可能绑定到 ServiceVersionType 对象的生命周期或静态存储区(解释)。 问题 Q-dc38956a7fe0476a (未决)因此,该视图的使用不应超出源实例的生命周期。
  • 调用上下文:作为无副作用的 const 操作,该调用不会修改对象;未指定单独的可重入性要求。

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

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

Header-Datei#include "ara/com/service/service_version.h"
Scopeclass ara::com::ServiceVersionType
Exception-Sicherheitnot exception safe

Rückgabewert

TypBeschreibung
ara::core::StringViewString representation of a ara::com::ServiceVersionType

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

Record
AUTOSAR/AP/record/SWS_CM_11519
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11519@rel:R25-11#799ad16d
Content hash
799ad16d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11519
Status: valid/unmigrated Version: rel:R25-11#abf5021f 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_11519@rel:R25-11#abf5021f
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#0f392a642026-09-30
  • R24-11rel:R24-11#2df22b872026-10-14
  • R25-11rel:R25-11#abf5021f2026-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_11517] Upstream: RS_CM_00200, RS_CM_00500

bool operator< (const ServiceVersionType &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/service_version.h"
Scopeclass ara::com::ServiceVersionType
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherara::com::ServiceVersionType 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_11517
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11517@rel:R25-11#94302bd7
Content hash
94302bd7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11517
Status: valid/unmigrated Version: rel:R25-11#2d7b1db2 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_11517@rel:R25-11#2d7b1db2
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#f371b0f02026-09-30
  • R24-11rel:R24-11#abc475902026-10-14
  • R25-11rel:R25-11#2d7b1db22026-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_11518] Upstream: RS_CM_00200, RS_CM_00500

ServiceVersionType & operator= (const ServiceVersionType &other);

Copy assignment constructor

Header-Datei#include "ara/com/service/service_version.h"
Scopeclass ara::com::ServiceVersionType
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherara::com::ServiceVersionType to copy

Rückgabewert

TypBeschreibung
ServiceVersionType &New ara::com::ServiceVersionType

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

Record
AUTOSAR/AP/record/SWS_CM_11518
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11518@rel:R25-11#8d967382
Content hash
8d967382
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11518
Status: valid/unmigrated Version: rel:R25-11#b8a11cec 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_11518@rel:R25-11#b8a11cec
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#a7abbb5e2026-09-30
  • R24-11rel:R24-11#31f02ac92026-10-14
  • R25-11rel:R25-11#b8a11cec2026-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_11516] Upstream: RS_CM_00200, RS_CM_00500

bool operator== (const ServiceVersionType &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/service_version.h"
Scopeclass ara::com::ServiceVersionType
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
otherara::com::ServiceVersionType 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_11516
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11516@rel:R25-11#5a4c3e79
Content hash
5a4c3e79
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11516
Status: valid/unmigrated Version: rel:R25-11#8e598b1d 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_11516@rel:R25-11#8e598b1d
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#b31c22602026-09-30
  • R24-11rel:R24-11#38d0957c2026-10-14
  • R25-11rel:R25-11#8e598b1d2026-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