DEENESPTFRRUARHIKOZHNL

类 ara::diag::Condition

[SWS_DM_00711] Upstream: RS_Diag_04192

class Condition final {...};

DiagnosticConditionInterface.

Header-Datei#include "ara/diag/condition.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopenamespace ara::diag

用户指南人工智能生成

向 Diagnostic Management 报告与车辆和系统相关的使能状态以评估诊断条件。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 40db6d76454c 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

向 Diagnostic Management 报告与车辆和系统相关的使能状态以评估诊断条件。

类 ara::diag::Condition 提供接口 DiagnosticConditionInterface,自适应应用程序通过该接口向 Diagnostic Management 报告环境条件和使能条件([SWS_DM_00712])。Diagnostic Server 评估这些状态,以有针对性地控制车辆中标准化诊断功能或清除操作的执行(AUTOSAR_AP_SWS_Diagnostics §7.3.2.5.5 “Condition checks”)。实例严格绑定到端口原型,既不可复制也不可移动。在并发使用时,查询和设置操作需要外部同步,因为它们不是线程安全的。

上下文

类 ara::diag::Condition 代表 AUTOSAR Adaptive Platform 中用于诊断条件(DiagnosticConditionInterface)的编程接口([SWS_DM_00712])。在车辆诊断系统中,仅当车辆处于定义的环境状态时(例如,在车速为零的车辆静止状态下),才允许执行某些诊断功能或 UDS 服务(AUTOSAR_AP_SWS_Diagnostics §7.3.2.5.5 “Condition checks”)。根据 [SWS_DM_00111],如果 ISO 14229-1 规定了特定于服务的条件检查,Diagnostic Server 将执行相应的环境检查,并在不满足时以配置的 Negative Response Code (NRC) 进行响应。

在应用程序架构中,ara::diag::Condition 充当自适应应用程序与 Diagnostic Management (DM) 之间的连接纽带。应用程序通过一个端口实例化条件对象,该端口在模型中通过 DiagnosticEnableConditionPortMapping 或 DiagnosticClearConditionPortMapping 关联([SWS_DM_00712])。解释:通过此端口分配来确定所报告的状态是用作常规诊断流程的使能条件,还是用作清除诊断数据的准则。 问题 (未决)因此,该对象封装了向 Diagnostic Server 的状态传输,该服务器评估传入诊断请求的条件([SWS_DM_00111])。

diag_condition_kontext app Anwendungssoftware cond ara::diag::Condition app->cond SetCondition / GetCondition dm 诊断管理 cond->dm Zustandsabgleich

上下文图:ara::diag::Condition 在应用程序软件与 Diagnostic Management 之间的集成。来源:[SWS_DM_00712],[SWS_DM_00111],AUTOSAR_AP_SWS_Diagnostics §7.3.2.5.5 “Condition checks”

生命周期

ara::diag::Condition 对象的创建通过向构造函数传递 ara::core::InstanceSpecifier 显式进行([SWS_DM_00712])。该标识符指向应用程序的建模端口原型。构造函数声明为 noexcept,并保证异常安全性以及线程安全性([SWS_DM_00712])。

在所有权方面,该类被设计为严格的单实例:复制构造函数([SWS_DM_01625])和复制赋值运算符([SWS_DM_01623])均已被删除(=delete)。同样,移动构造函数([SWS_DM_01626])和移动赋值运算符([SWS_DM_01624])也被删除。条件对象既不能复制也不能移动,这确保了与相应端口的固定 1:1 分配。

在运行过程中,方法 SetCondition([SWS_DM_00715])和 GetCondition([SWS_DM_00714])被指定为非线程安全。在来自多个线程的并发访问时,调用方应用程序必须确保外部同步。生命周期以析构函数 ~Condition()([SWS_DM_00713])结束,该析构函数为 noexcept 且异常安全,但同样不是线程安全的。

使用路径

典型使用路径包括初始化、状态的定期更新以及条件的查询:

  1. 初始化:应用程序在指定匹配的 ara::core::InstanceSpecifier([SWS_DM_00712])的情况下实例化 ara::diag::Condition,以连接到模型配置。
  2. 设置状态:如果相关的车辆或系统状态发生变化,应用程序通过 SetCondition(condition)([SWS_DM_00715])更新条件。该调用通过 ara::core::Result<void> 确认采纳。
  3. 查询状态:为了检查当前状态,应用程序调用 GetCondition()([SWS_DM_00714])。结果通过 ara::core::Future<ConditionType> 异步提供。
  4. 服务器处理:解释:Diagnostic Server 在内部访问存储的状态,以检查待处理的诊断请求([SWS_DM_00111])。 问题 Q-bbf48f735ef80e33 (未决)
  5. 终止:在组件终止时,该对象通过析构函数释放([SWS_DM_00713])。
Typischer Nutzungspfad von ara::diag::Condition应用Condition诊断管理Condition(specifier)Port-Bindung registrierenSetCondition(condition)Bedingungszustand aktualisierenResult<void>GetCondition()Future<ConditionType>~Condition()

时序图:用于初始化、更新和查询诊断条件的典型调用顺序。来源:[SWS_DM_00712],[SWS_DM_00715],[SWS_DM_00714],[SWS_DM_00713]

错误场景

错误状态可能在对象实例化期间以及运行期间发生:

  • 构造函数违规:在创建([SWS_DM_00712])时,框架会根据软件模型验证配置。可能的违规包括:
    • InstanceSpecifierMappingIntegrityViolation:标识符无法在模型中解析,或者未引用 PortPrototype([SWS_DM_00712])。
    • PortInterfaceMappingViolation:虽然 PortPrototype 由 DiagnosticConditionInterface 定型,但既未被 DiagnosticEnableConditionPortMapping 引用,也未被 DiagnosticClearConditionPortMapping 引用([SWS_DM_00712])。
    • ProcessMappingViolation:对于实例引用,运行时不存在匹配的建模进程([SWS_DM_00712])。
    • InstanceSpecifierAlreadyInUseViolation:标识符在同一进程中已被另一个实例使用([SWS_DM_00712])。
  • 诊断基础服务故障:如果 Diagnostic Management 的基本功能暂时不可用,GetCondition()([SWS_DM_00714])可能会通过返回的 ara::core::Future 失败并带有错误 DiagErrc::kServiceNotAvailable。
  • 无错误状态保存:对于 SetCondition()([SWS_DM_00715]),未定义标准化的错误代码;该函数直接通过空的 ara::core::Result<void> 报告成功。

本文由 AI 生成。所有专业陈述均严格基于 AUTOSAR R25-11 规范。

成员图

构造函数和析构函数

2

运算符

1

类图

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

G nara__diag__Condition778 Condition + Condition() + operator=() + ~Condition() + GetCondition() + SetCondition()

详细视图

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

构造函数和析构函数

Condition 函数 3

Constructor of Condition Class.

重载 Condition 3
explicit Condition (const ara::core::InstanceSpecifier &specifier) noexcept; SWS_DM_00712
Condition (Condition &)=delete; SWS_DM_01625
Condition (Condition &&) noexcept=delete; SWS_DM_01626
~Condition 函数

Destructor of class Condition .

~Condition () noexcept;

方法

Get current condition.

ara::core::Future< ConditionType > GetCondition () noexcept;

Set condition.

ara::core::Result< void > SetCondition (ConditionType condition) noexcept;

运算符

operator= 函数 2

Condition shall be a single not assignable instance.

重载 = 2
Condition & operator= (Condition &)=delete; SWS_DM_01623
Condition & operator= (Condition &&)=delete; SWS_DM_01624

方法文档

函数 Condition [SWS_DM_00712] Upstream: RS_AP_00137, RS_Diag_04192, RS_AP_00170, RS_AP_00171, RS_AP_00172, RS_AP_00173

explicit Condition (const ara::core::InstanceSpecifier &specifier) noexcept;

Constructor of Condition Class.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe
Verletzungen (Violations)InstanceSpeci- InstanceSpecifier either cannot be resolved in the model in the fierMappingIn- context of your executable, or it refers to a model element other tegrityViolation than a PortPrototype. PortInterfaceMap- A PortPrototype that is typed by a pingViolation DiagnosticConditionInterface needs either to be referenced by a DiagnosticEnableConditionPortMapping or a DiagnosticClearConditionPortMapping. ProcessMappingVio- Matching InstanceRef exists, but no matching (modelled) Process lation found that matches the (runtime) process. InstanceSpecifier- Violation message that is sent in case a constructor in the ara AlreadyInUseViola- framework was called with an InstanceSpecifier already in use in tion this process.

Parameter (in)

ParameterBeschreibung
specifierInstanceSpecifier to a PortPrototype of a DiagnosticConditionInterface.

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

Record
AUTOSAR/AP/record/SWS_DM_00712
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00712@rel:R25-11#829f70c3
Content hash
829f70c3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00712
Status: valid/unmigrated Version: rel:R25-11#7b668fd5 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_DM_00712@rel:R25-11#7b668fd5
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b888c2422026-09-30
  • R19-11rel:R19-11#174e087a2026-10-14
  • R20-11rel:R20-11#a3c343192026-10-14
  • R21-11rel:R21-11#a3c343192026-10-14
  • R22-11rel:R22-11#39f9faa92026-10-14
  • R23-11rel:R23-11#90311ab32026-10-14
  • R24-11rel:R24-11#abbd838c2026-10-14
  • R25-11rel:R25-11#7b668fd52026-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

函数 Condition [SWS_DM_01625] Upstream: RS_AP_00147

Condition (Condition &)=delete;

Condition shall be a single not copy-able instance.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition

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

Record
AUTOSAR/AP/record/SWS_DM_01625
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01625@rel:R25-11#d4e6ebac
Content hash
d4e6ebac
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01625
Status: valid/unmigrated Version: rel:R25-11#beec4163 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_DM_01625@rel:R25-11#beec4163
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#ca5f204e2026-09-30
  • R23-11rel:R23-11#01e7045c2026-10-14
  • R24-11rel:R24-11#c44ce0db2026-10-14
  • R25-11rel:R25-11#beec41632026-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

函数 Condition [SWS_DM_01626] Upstream: RS_AP_00147

Condition (Condition &&) noexcept=delete;

Move constructor of Condition.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition

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

Record
AUTOSAR/AP/record/SWS_DM_01626
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01626@rel:R25-11#b441c06b
Content hash
b441c06b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01626
Status: valid/unmigrated Version: rel:R25-11#ca51f3d8 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_DM_01626@rel:R25-11#ca51f3d8
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#ac9f36c82026-09-30
  • R23-11rel:R23-11#a312623b2026-10-14
  • R24-11rel:R24-11#ca51f3d82026-10-14
  • R25-11rel:R25-11#ca51f3d82026-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

函数 GetCondition [SWS_DM_00714] Upstream: RS_AP_00139, RS_Diag_04192

ara::core::Future< ConditionType > GetCondition () noexcept;

Get current condition.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Rückgabewert

TypBeschreibung
ara::core::Future<ConditionType >the current condition

Fehler

FehlercodeBeschreibung
DiagErrc::kServiceNotAvailablerollback_semantics The call cannot be executed, because essential DM functionality is currently not available.

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

Record
AUTOSAR/AP/record/SWS_DM_00714
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00714@rel:R25-11#fbfc95db
Content hash
fbfc95db
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00714
Status: valid/unmigrated Version: rel:R25-11#cff60f5e 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_DM_00714@rel:R25-11#cff60f5e
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#9ee1c93d2026-09-30
  • R19-11rel:R19-11#dfa0a5692026-10-14
  • R20-11rel:R20-11#c75637cb2026-10-14
  • R21-11rel:R21-11#68ca7fb32026-10-14
  • R22-11rel:R22-11#95e6fb892026-10-14
  • R23-11rel:R23-11#941e11c02026-10-14
  • R24-11rel:R24-11#6ceaf9c22026-10-14
  • R25-11rel:R25-11#cff60f5e2026-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

函数 SetCondition [SWS_DM_00715] Upstream: RS_AP_00139, RS_Diag_04192

ara::core::Result< void > SetCondition (ConditionType condition) noexcept;

Set condition.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
conditioncurrent condition

Rückgabewert

TypBeschreibung
ara::core::Result< void >Returns void.

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

Record
AUTOSAR/AP/record/SWS_DM_00715
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00715@rel:R25-11#ed09eefc
Content hash
ed09eefc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00715
Status: valid/unmigrated Version: rel:R25-11#334a5f3b 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_DM_00715@rel:R25-11#334a5f3b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#8b4774082026-09-30
  • R19-11rel:R19-11#a92f5c212026-10-14
  • R20-11rel:R20-11#05dc5cfa2026-10-14
  • R21-11rel:R21-11#05dc5cfa2026-10-14
  • R22-11rel:R22-11#4eee24142026-10-14
  • R23-11rel:R23-11#63e48b532026-10-14
  • R24-11rel:R24-11#69cd75ef2026-10-14
  • R25-11rel:R25-11#334a5f3b2026-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_DM_01623] Upstream: RS_AP_00147

Condition & operator= (Condition &)=delete;

Condition shall be a single not assignable instance.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition

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

Record
AUTOSAR/AP/record/SWS_DM_01623
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01623@rel:R25-11#7d7b4710
Content hash
7d7b4710
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01623
Status: valid/unmigrated Version: rel:R25-11#fc39b2c9 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_DM_01623@rel:R25-11#fc39b2c9
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#ceedce912026-09-30
  • R23-11rel:R23-11#da53ca842026-10-14
  • R24-11rel:R24-11#fc39b2c92026-10-14
  • R25-11rel:R25-11#fc39b2c92026-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_DM_01624] Upstream: RS_AP_00147

Condition & operator= (Condition &&)=delete;

Move assignment operator of Condition.

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition

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

Record
AUTOSAR/AP/record/SWS_DM_01624
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01624@rel:R25-11#41eaf01c
Content hash
41eaf01c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01624
Status: valid/unmigrated Version: rel:R25-11#cd68da4f 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_DM_01624@rel:R25-11#cd68da4f
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#08f5a51a2026-09-30
  • R23-11rel:R23-11#c22af3482026-10-14
  • R24-11rel:R24-11#cd68da4f2026-10-14
  • R25-11rel:R25-11#cd68da4f2026-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

函数 ~Condition [SWS_DM_00713] Upstream: RS_AP_00134, RS_Diag_04192

~Condition () noexcept;

Destructor of class Condition .

Header-Datei#include "ara/diag/condition.h"
Scopeclass ara::diag::Condition
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

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

Record
AUTOSAR/AP/record/SWS_DM_00713
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00713@rel:R25-11#00fd0424
Content hash
00fd0424
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00713
Status: valid/unmigrated Version: rel:R25-11#a0b1a1c6 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_DM_00713@rel:R25-11#a0b1a1c6
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#70f2dd252026-09-30
  • R19-11rel:R19-11#0982897b2026-10-14
  • R20-11rel:R20-11#842e2f302026-10-14
  • R21-11rel:R21-11#842e2f302026-10-14
  • R22-11rel:R22-11#45e9fe152026-10-14
  • R23-11rel:R23-11#c0cf50322026-10-14
  • R24-11rel:R24-11#a0b1a1c62026-10-14
  • R25-11rel:R25-11#a0b1a1c62026-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