类 ara::core::Executor
[SWS_CORE_00008] Upstream: RS_AP_00130
class Executor {...};
Provides an interface for a executing context, which asynchronously invokes Callable ([4] [func.wrap.func]) objects in a guaranteed thread-safe context. The execute(...) method in [SWS_CORE_00024] returns a ara::core::Future object to the caller for further result/error extraction or management of the asynchronous-context; the execute_oneway(...) method in [SWS_CORE_00025] imply fire-and-forget semantics and thus no asynchronous-context (ara::core::Future ) is returned.
Literaturverzeichnis SWS Core: [4] ISO/IEC 14882:2014, Information technology – Programming languages – C++ – www.iso.org
Header-Datei #include "ara/core/executor.h" Forwarding-Header #include "ara/core/core_fwd.h" Scope namespace ara::core
用户指南人工智能生成 允许异步、线程安全地执行可调用对象,并可选择通过 Future 返回结果。
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 690890643de1
来源
未决问题(2)
摘要 详细
允许异步、线程安全地执行可调用对象,并可选择通过 Future 返回结果。
类 ara::core::Executor 提供了在保证线程安全的上下文中异步执行可调用对象的接口。任务既可以通过 execute [SWS_CORE_00024] 以结果导向的方式启动,并返回用于值或错误代码的 ara::core::Future;也可以通过 oneway_execute [SWS_CORE_00025] 在 Fire-and-Forget 模式下以与状态无关的方式传递。作为关键边界条件需要注意的是,execute 本身不是线程安全的,在同一实例上的并发调用必须在外部进行同步,而 Callable 在后台的执行则是线程安全的。
更多 ›
上下文
类 ara::core::Executor 为执行上下文提供接口,该上下文在有保证的线程安全环境中异步执行可调用单元(Callable)。它充当调用线程与异步后台处理之间的抽象层。对于任务传递,有两种机制可用:方法 execute [SWS_CORE_00024] 以结果导向的方式传递任务并返回 ara::core::Future 对象,可以通过该对象同步并查询后续的返回值或错误代码。对于纯通知或与状态无关的后台操作,该类提供了方法 oneway_execute [SWS_CORE_00025] ,该方法遵循 Fire-and-Forget 语义,不向调用方返回异步上下文。推测具体的后台实现封装了线程管理或任务队列,以协调并发处理。 问题 Q-068fe33f2900d6cf (未决)
生命周期
ara::core::Executor 的实例化和生命周期在异常安全性和线程安全性方面遵循差异化的规则:
关于运行期间的并发性,呈现出一种根本性的划分:虽然 oneway_execute [SWS_CORE_00025] 是线程安全的,但 execute [SWS_CORE_00024] 被归类为非线程安全。execute 缺乏线程安全性可能是由于内部生成和管理所得 Future 的底层状态对象所致,因此必须对同一实例上 execute 的并发调用进行外部同步。 问题 Q-4425e6b07758230e (未决)
使用路径
ara::core::Executor 的使用分为两条主要路径,具体取决于是否需要返回值:
结果导向路径(execute): 调用方将可调用对象 f 以及可选参数 p... 传递给 execute [SWS_CORE_00024] 。该方法立即返回一个 ara::core::Future,其结果类型基于调用的推导返回类型。Callable 在有保证的上下文中异步执行。一旦处理完成,调用方就可以从 Future 中提取结果值或潜在的错误代码。
单向路径(oneway_execute): 如果调用方既不需要反馈也不需要同步,则调用 oneway_execute [SWS_CORE_00025] 。Callable 同样异步执行,但不存在返回值(void)。
使用 ara::core::Executor 的异步执行流程 调用方 ara::core::Executor Asynchroner Kontext ara::core::Future execute(f, p...) Future erzeugen 返回 ara::core::Future f(p...) asynchron starten 执行 Callable f(p...) 设置结果或错误 Ergebnis / Fehler abfragen Ergebniswert / Fehlercode
时序图:通过 execute 进行异步任务处理以及通过 Future 查询结果。来源:[SWS_CORE_00024]
错误场景
调用方法 execute [SWS_CORE_00024] 和 oneway_execute [SWS_CORE_00025] 不抛出 C++ 异常;两者均被显式指定为 noexcept。同样,规范未针对 execute 的传递调用本身定义标准化错误代码 [SWS_CORE_00024] 。
然而,如果在 Callable 的异步处理期间发生错误,则该错误将通过 execute 返回的 ara::core::Future 传播:在发生错误时,Future 封装错误代码;而在成功时,将提供带有函数结果的类型 ara::core::Result::value_type [SWS_CORE_00024] 。对于 oneway_execute [SWS_CORE_00025] ,由于设计原因,无法向调用方返回错误;错误保留在异步上下文中。
本指南由 AI 整理,并完全基于 AUTOSAR Adaptive R25-11 规范。
分组依据 类别 历史
成员图 类图 Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
G
nara__core__Executor877
Executor
+ Executor()
+ operator=()
+ ~Executor()
+ execute()
+ oneway_execute()
详细视图 此版本没有元素数据
构造函数和析构函数 Copy constructor
重载 Executor 2 方法 Asynchronously invoke F with the provided arguments P....
Asynchronously invoke F with the provided arguments P....
template <class F, class... P> void oneway_execute (F &&f, P &&... p) noexcept;
运算符 Copy assignment operator
重载 = 2
点击条目以查看其关系。
基类 派生类 使用 被使用于 继承 自此版本起移除 用于 此类中无关联 函数 AI 评注 打开类页面 无法加载类页面。 调整顺序 调整宽度 调整大纲宽度 章节 阅读时间 SWS 引用 图表 放回中间 调整顺序或拖到标题栏 取消停靠 – 在内容中显示 移到中间栏 作为标签停靠到标题栏 元素 AI 模型 打开审计档案 档案 打开简短版本 打开中等版本 打开完整版本 恢复默认视图 已恢复默认视图 撤销 关闭详细视图 签名 基本信息 值 截至所选版本的最后一次更改 之后的下一次更改 单击:选择版本 无法放在此处:拖到标题栏可停靠,拖到中间栏可取消停靠。 新增 已更改 未更改 已移除 未包含 更改 内容无变化 首次出现于 移除于 没有可用的版本数据。 正在加载版本数据 … 文本 此版本未收录措辞 悬停或单击单元格:与所选版本比较 · 单击版本标题:选择版本 选择版本 属性 版本 元素 只有一个版本有措辞 PDF 中存在,原文尚未导入 首次采集原文 自 {rel} 起未更改 版本颜色 最早版本 最新版本
方法文档
Executor (const Executor &other);
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit not exception safe Thread-Sicherheit thread-safe
Parameter (in)
Status: valid/unmigrated
Version: rel:R25-11#60a2a566
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_CORE_00009@rel:R25-11#60a2a566
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#3391383e2026-09-30 Inspect R24-11 rel:R24-11#6c85f96c2026-10-14 Inspect R25-11 rel:R25-11#60a2a5662026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
Executor (Executor &&other) noexcept;
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit exception safe Thread-Sicherheit not thread-safe
Parameter (in)
Status: valid/unmigrated
Version: rel:R25-11#aa1a25ba
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_CORE_00015@rel:R25-11#aa1a25ba
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#5a1547e72026-09-30 Inspect R24-11 rel:R24-11#0606a2422026-10-14 Inspect R25-11 rel:R25-11#aa1a25ba2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
template <class F, class... P> ara::core::Future < std::invoke_result_t < std::decay_t < F >, std::decay_t < P >... > > execute (F &&f, P &&... p) noexcept;
Asynchronously invoke F with the provided arguments P....
用户指南
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9d31d266cefd
来源
未决问题(1)
本文自动生成。所有专业内容均基于 AUTOSAR Adaptive R25-11 规范。
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit exception safe Thread-Sicherheit not thread-safe
Template-Parameter
Parameter Beschreibung F a Callable type P argument list to the Callable
Parameter (in)
Parameter Beschreibung f a Callable to be executed p parameters to be supplied with the Callable
Rückgabewert
Typ Beschreibung ara::core::Future <std::invoke_result_t<std::decay_t< F >, std::decay_t< P >... > >• If successful: an ara::core::Future containing a ara:: core::Result::value_type containing the result of the callable F • If unsuccessful: an ara::core::Future containing an Error Code
Fehler
Fehlercode Beschreibung This function does not specify any standardized errors.
Status: valid/unmigrated
Version: rel:R25-11#6c85a6a9
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_CORE_00024@rel:R25-11#6c85a6a9
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#8144c3b12026-09-30 Inspect R24-11 rel:R24-11#d465a8212026-10-14 Inspect R25-11 rel:R25-11#6c85a6a92026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
template <class F, class... P> void oneway_execute (F &&f, P &&... p) noexcept;
Asynchronously invoke F with the provided arguments P....
用户指南
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 1e96ad32e48d
来源
未决问题(1)
本使用说明基于 AUTOSAR R25-11 自动创建。
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Template-Parameter
Parameter Beschreibung F a Callable type P argument list to the Callable
Parameter (in)
Parameter Beschreibung f a Callable to be executed p parameters to be supplied with the Callable
Rückgabewert
Status: valid/unmigrated
Version: rel:R25-11#f89da2ea
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_CORE_00025@rel:R25-11#f89da2ea
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#ebd0128b2026-09-30 Inspect R24-11 rel:R24-11#fe75fa6e2026-10-14 Inspect R25-11 rel:R25-11#f89da2ea2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
Executor & operator= (const Executor &other);
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit not exception safe Thread-Sicherheit thread-safe
Parameter (in)
Rückgabewert
Typ Beschreibung Executor &The copied object
Status: valid/unmigrated
Version: rel:R25-11#6011a69d
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_CORE_00017@rel:R25-11#6011a69d
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#c0dcae292026-09-30 Inspect R24-11 rel:R24-11#137015232026-10-14 Inspect R25-11 rel:R25-11#6011a69d2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
Executor & operator= (Executor &&other) noexcept;
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit exception safe Thread-Sicherheit not thread-safe
Parameter (in)
Rückgabewert
Typ Beschreibung Executor &The moved object
Status: valid/unmigrated
Version: rel:R25-11#1ca71ff7
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_CORE_00018@rel:R25-11#1ca71ff7
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#57cffdd32026-09-30 Inspect R24-11 rel:R24-11#15bce54f2026-10-14 Inspect R25-11 rel:R25-11#1ca71ff72026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
~Executor () noexcept;
Header-Datei #include "ara/core/executor.h" Scope class ara::core::Executor Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Status: valid/unmigrated
Version: rel:R25-11#336c443d
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_CORE_00019@rel:R25-11#336c443d
Point-in-Time History:
Release:
R25-11 (Current / Active) R24-11 R20-11 R19-11
View Snapshot
Recorded Revisions (3):
R25-11 rel:R25-11#96c96d482026-09-30 Inspect R24-11 rel:R24-11#7a18cb1c2026-10-14 Inspect R25-11 rel:R25-11#336c443d2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
gemini-3.8-flash-low· 2026-10-13 · 德文原文