DEENESPTFRRUARHIKOZHNL

类 ara::core::Future

[SWS_CORE_00321] Upstream: RS_AP_00130

template <typename T, typename E = ErrorCode> class Future final {...};

Implementation of std::future from [future.syn] in [11]. The implementation shall flag the condition E != ara::core::ErrorCode as a compile error.

Literaturverzeichnis SWS Core: [11] ISO/IEC 14882:2017, Programming languages – C++ – www.iso.org

Header-Datei#include "ara/core/future.h"
Forwarding-Header#include "ara/core/core_fwd.h"
Scopenamespace ara::core

用户指南人工智能生成

支持从并发操作中同步或异步接收值与错误。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: fbd974cb6be2 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持从并发操作中同步或异步接收值与错误。

类 ara::core::Future 用作异步操作结果的接收端句柄,并管理对共享状态(Shared State)的访问 [SWS_CORE_00327]。消费者可以非阻塞地检查状态、同步等待完成,或者通过 GetResult() 以无异常方式作为 ara::core::Result 获取结果 [SWS_CORE_00336]。由于复制操作已被删除,所有权受到独占管理,并且在获取结果或通过 Continuation 转发之后,该对象会立即变为无效。

上下文

模板类 ara::core::Future 代表 AUTOSAR Adaptive Platform 内异步操作结果的接收端元素。它允许对由生成方实例异步填充的共享状态(Shared State)进行受控访问 [SWS_CORE_00327]。从概念上讲,该类实现了 C++17 标准 ISO/IEC 14882:2017 [11] 中的 std::future,但无缝集成到了平台的基于非异常错误的概念中:模板参数 E 必须指定错误类型 ara::core::ErrorCode;任何偏离的规范都会导致编译错误。主要交互方包括提供值或错误的异步生成方(例如关联的 Promise)、作为独占接收端的 Future 实例,以及后续任务所传递至的消费者或执行上下文 (ExecutorT) [SWS_CORE_00331] [SWS_CORE_00337]。

生命周期

ara::core::Future 的创建、状态管理和销毁遵循严格的规则,以确保确定性的所有权关系:

future_lifecycle Invalid Ungueltig (valid() == false) ValidPending Gueltig / Ausstehend (valid() == true, is_ready() == false) Invalid->ValidPending Move-Zuweisung / Erhalt ValidPending->Invalid Destruktor / then() ValidReady Gueltig / Bereit (valid() == true, is_ready() == true) ValidPending->ValidReady Promise 设置值或错误 ValidReady->Invalid GetResult() / get() / then()

状态图:Future 实例关于共享状态有效性和可用性的生命周期及状态转换。来源:[SWS_CORE_00322]、[SWS_CORE_00326]、[SWS_CORE_00327]、[SWS_CORE_00331]、[SWS_CORE_00332]、[SWS_CORE_00333]、[SWS_CORE_00336]

使用路径

用于结果处理的典型使用路径分为以下阶段:

  1. 状态检查与同步:可以使用 is_ready() 预先确定异步结果是否已经就绪 [SWS_CORE_00332]。如果已经就绪,后续获取保证不再阻塞 [SWS_CORE_00332]。否则,可以使用 wait() 进行无期限同步 [SWS_CORE_00328],或通过 wait_for() 或 wait_until() 进行有时间限制的同步 [SWS_CORE_00329] [SWS_CORE_00330]。
  2. 结果提取:在 AUTOSAR Adaptive 应用程序中,调用 GetResult() 至关重要:该方法在需要时发生阻塞,但绝不抛出异常,并以 Move 方式将值或错误作为 ara::core::Result<T, E> 传递 [SWS_CORE_00336]。方法 get() 提供 STL 符合性,在出错时抛出 C++ 异常,并在工具链禁用异常处理时不参与重载决议 [SWS_CORE_00326]。
  3. 异步链式调用(Continuations):除了同步阻塞之外,还可以通过 then() 注册回调,可选地分配给执行上下文(Executor)[SWS_CORE_00331] [SWS_CORE_00337]。回调将结果作为 Result<T, E> 右值接收。如果延续函数本身返回 Future 或 Result,则 then() 执行自动解包(Unwrapping)并直接提供相应的 Future<T2, E2> [SWS_CORE_00331] [SWS_CORE_00337]。
使用 GetResult() 的异步流程调用方FuturePromiseErzeugt Shared State & FutureUebergabe an KonsumentUse Case: 同步与检索is_ready()falseSetResult(...) / SetError(...)GetResult()Shared State geleertvalid() == falseResult<T, E>

时序图:通过 GetResult() 进行异步同步和结果获取的典型流程。来源:[SWS_CORE_00327]、[SWS_CORE_00332]、[SWS_CORE_00336]

错误场景

在使用 ara::core::Future 时,规定了以下错误情况:

本指南完全基于 AUTOSAR Adaptive Core (R25-11) 的规范要求。

成员图

类图

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

G nara__core__Future930 Future + Future() + operator=() + ~Future() + GetResult() + get() + is_ready() + then() + valid() + wait() + wait_for() + wait_until()

详细视图

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

构造函数和析构函数

Future 函数 3

Default constructor This function shall behave the same as the corresponding std::future function. ≙ std::future

重载 Future 3
Future () noexcept=default; SWS_CORE_00322
Future (Future &&other) noexcept; SWS_CORE_00323
Future (const Future &)=delete; SWS_CORE_00334
~Future 函数

Destructor for Future objects. Abandons any shared state

~Future () noexcept;

方法

get 函数

Get the value.

T get () noexcept(false);
GetResult 函数

Get the result.

Result< T, E > GetResult () noexcept(std::is_nothrow_move_ constructible< T >::value &&std::is_nothrow_move_constructible< E >::value);
is_ready 函数

Return whether the asynchronous operation has finished.

bool is_ready () const noexcept;
then 函数 2

Create a new Future with the content returned by func when passed the Result of this Future. The callable func may be called in the context of this call or in the context of • Promise::set_result(const T&) • Promise::set_result(T&&) • Promise::SetError(E&&) • Promise::SetError(const E&) or somewhere else.

重载 then 2
template <typename F> auto then (F &&func) noexcept -> Future< <see below> >; SWS_CORE_00331
template <typename F, typename ExecutorT> auto then (F &&func, ExecutorT &&executor) noexcept -> Future< <see below> >; SWS_CORE_00337
valid 函数

Checks if the Future is valid, i.e. if it has a shared state.

bool valid () const noexcept;
wait 函数

Wait for a value or an error to be available.

void wait () const noexcept;
wait_for 函数

Wait for the timeoutDuration or until a value or an error is available.

template <typename Rep, typename Period> FutureStatus wait_for (const std::chrono::duration< Rep, Period > &timeoutDuration) const noexcept;
wait_until 函数

Wait until the deadline or until a value or an error is available.

template <typename Clock, typename Duration> FutureStatus wait_until (const std::chrono::time_point< Clock, Duration > &deadline) const noexcept;

运算符

operator= 函数 2

Move assign from another instance. This function shall behave the same as the corresponding std::future function. ≙ std::future

重载 = 2
Future & operator= (Future &&other) noexcept; SWS_CORE_00325
Future & operator= (const Future &)=delete; SWS_CORE_00335

方法文档

函数 Future [SWS_CORE_00322] Upstream: RS_AP_00130

Future () noexcept=default;

Default constructor This function shall behave the same as the corresponding std::future function.

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe

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

Record
AUTOSAR/AP/record/SWS_CORE_00322
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00322@rel:R25-11#02a61753
Content hash
02a61753
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00322
Status: valid/unmigrated Version: rel:R25-11#869eb074 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_CORE_00322@rel:R25-11#869eb074
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#f20c46ff2026-09-30
  • R19-11rel:R19-11#dea6599e2026-10-14
  • R20-11rel:R20-11#40f0427d2026-10-14
  • R21-11rel:R21-11#40f0427d2026-10-14
  • R22-11rel:R22-11#3116da522026-10-14
  • R23-11rel:R23-11#42749bfd2026-10-14
  • R24-11rel:R24-11#27bc40832026-10-14
  • R25-11rel:R25-11#869eb0742026-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

函数 Future [SWS_CORE_00323] Upstream: RS_AP_00130

Future (Future &&other) noexcept;

Move constructor from another instance This function shall behave the same as the corresponding std::future function.

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
otherthe other instance

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

Record
AUTOSAR/AP/record/SWS_CORE_00323
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00323@rel:R25-11#a6a022c8
Content hash
a6a022c8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00323
Status: valid/unmigrated Version: rel:R25-11#67bc21d5 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_CORE_00323@rel:R25-11#67bc21d5
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#16df79b52026-09-30
  • R19-11rel:R19-11#8b1810862026-10-14
  • R20-11rel:R20-11#d2675b492026-10-14
  • R21-11rel:R21-11#9ce1ca602026-10-14
  • R22-11rel:R22-11#62a98b892026-10-14
  • R23-11rel:R23-11#d38da6892026-10-14
  • R24-11rel:R24-11#7f1618232026-10-14
  • R25-11rel:R25-11#67bc21d52026-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

函数 Future [SWS_CORE_00334] Upstream: RS_AP_00130

Future (const Future &)=delete;

Copy constructor shall be disabled

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future

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

Record
AUTOSAR/AP/record/SWS_CORE_00334
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00334@rel:R25-11#a1d5ba0b
Content hash
a1d5ba0b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00334
Status: valid/unmigrated Version: rel:R25-11#1f07079c 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_CORE_00334@rel:R25-11#1f07079c
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#108bb8a72026-09-30
  • R19-11rel:R19-11#4a6d37412026-10-14
  • R20-11rel:R20-11#a10780802026-10-14
  • R21-11rel:R21-11#2f2e218f2026-10-14
  • R22-11rel:R22-11#2129f6a42026-10-14
  • R23-11rel:R23-11#ce09ab2b2026-10-14
  • R24-11rel:R24-11#7862d2022026-10-14
  • R25-11rel:R25-11#1f07079c2026-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

函数 GetResult [SWS_CORE_00336] Upstream: RS_AP_00130

Result< T, E > GetResult () noexcept(std::is_nothrow_move_ constructible< T >::value &&std::is_nothrow_move_constructible< E >::value);

Get the result.

Similar to Future::get(), this call blocks until the value or an error is available. However, this call will never throw an exception.

As per std::future, after this function is called the Future is no longer valid ( valid() ==FALSE ).

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitconditionally exception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid() ==FALSE ). lation

Rückgabewert

TypBeschreibung
Result< T, E >a ara::core::Result as std::move( result from the shared state) with either a value or an error that has been put into the corresponding Promise. This can be because either: • – Promise::SetError(E&&) – Promise::SetError(const E&) – Promise::SetResult(const Result<T, E>&) – Promise::SetResult(Result<T, E>&&) • the Promise was broken, meaning the shared state was abandoned by the corresponding Promise. Then the error is kBrokenPromise as defined in [SWS_CORE_00400].

Fehler

FehlercodeBeschreibung
FutureErrc::kBrokenPromiserollback_semantics if the Promise was broken, meaning the shared state was abandoned by the corresponding Promise.

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

Record
AUTOSAR/AP/record/SWS_CORE_00336
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00336@rel:R25-11#1d60ec13
Content hash
1d60ec13
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00336
Status: valid/unmigrated Version: rel:R25-11#0af67485 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_CORE_00336@rel:R25-11#0af67485
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7983aa762026-09-30
  • R19-11rel:R19-11#1ac6dc312026-10-14
  • R20-11rel:R20-11#652256322026-10-14
  • R21-11rel:R21-11#652256322026-10-14
  • R22-11rel:R22-11#8964f0202026-10-14
  • R23-11rel:R23-11#2380a90e2026-10-14
  • R24-11rel:R24-11#09c337922026-10-14
  • R25-11rel:R25-11#0af674852026-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

函数 get [SWS_CORE_00326] Upstream: RS_AP_00130

T get () noexcept(false);

Get the value.

This function shall behave the same as the corresponding std::future function.

As per std::future, after this function is called the Future is no longer valid ( valid() ==FALSE ).

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

使用

方法 get() 从 ara::core::Future 中同步检索类型为 T 的结果 [SWS_CORE_00326]。该函数的行为与 std::future 中的对应部分完全相同;如果异步计算仍在进行,调用将阻塞直到完成或直到发生错误 [SWS_CORE_00336]。通过该调用,对象会失去其状态,从而使 Future 立即失效(valid() == false)[SWS_CORE_00326]。可以通过 is_ready() 预先确保非阻塞调用 [SWS_CORE_00332]。

错误处理

失败会通过 C++ 异常进行报告 [SWS_CORE_00326]:

  • 如果在关联的 Promise 中通过 SetError() 或 SetResult() 存放了错误,则会触发相应错误类型的异常 [SWS_CORE_00326]。
  • 如果共享状态被异步操作提前放弃,根据 FutureErrc 这会导致错误 kBrokenPromise [SWS_CORE_00326]、[SWS_CORE_00400]。
  • 如果调用是在无效实例上进行的,则抛出带有错误码 kNoState 的 FutureException [SWS_CORE_00326]。

并发性与限制

该操作既不是线程安全的,也不是异常安全的(not exception safe)[SWS_CORE_00326]。从多个线程对同一个 Future 的并发访问需要外部同步。如果在编译器工具链中禁用了异常,则 get() 不参与重载解析 [SWS_CORE_00326];针对这种情况存在无异常的替代方案 GetResult() [SWS_CORE_00336]。对于没有返回值的实例,可以使用特化 Future<void, E>::get() [SWS_CORE_06226]。

本使用说明基于 AUTOSAR Adaptive R25-11 规范自动生成。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitnot exception safe
Thread-Sicherheitnot thread-safe

Rückgabewert

TypBeschreibung
Tvalue of type T

Exceptions

Any exception of the type associated with the error that has been put into the corresponding Promise. This can be because either: • explicit setting of the Error via: – Promise::SetError(E&&) – Promise::SetError(const E&) – Promise::SetResult(const Result<T, E>&) – Promise::SetResult(Result<T, E>&&) • the Promise was broken, meaning the shared state was abandoned by the corresponding Promise. Then the error is kBrokenPromise as defined in [SWS_CORE_00400]. FutureException if the Future is invalid. The contained ErrorCode is kNoState

Hinweise: This function shall not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain

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

Record
AUTOSAR/AP/record/SWS_CORE_00326
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00326@rel:R25-11#98fbb85f
Content hash
98fbb85f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00326
Status: valid/unmigrated Version: rel:R25-11#86352c5a 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_CORE_00326@rel:R25-11#86352c5a
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#772635442026-09-30
  • R19-11rel:R19-11#bf2bb1bc2026-10-14
  • R20-11rel:R20-11#1b0259a32026-10-14
  • R21-11rel:R21-11#e72dc9d62026-10-14
  • R22-11rel:R22-11#5fce45d52026-10-14
  • R23-11rel:R23-11#2294bfde2026-10-14
  • R24-11rel:R24-11#83b80b3f2026-10-14
  • R25-11rel:R25-11#86352c5a2026-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

函数 is_ready [SWS_CORE_00332] Upstream: RS_AP_00130

bool is_ready () const noexcept;

Return whether the asynchronous operation has finished.

If this function returns TRUE, get(), GetResult() and the wait() calls are guaranteed not to block.

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid() ==FALSE ). lation

Rückgabewert

TypBeschreibung
bool• TRUE: the Future contains a value or an error • FALSE: the Future does NOT contain a value or an error

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

Record
AUTOSAR/AP/record/SWS_CORE_00332
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00332@rel:R25-11#9320e8a3
Content hash
9320e8a3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00332
Status: valid/unmigrated Version: rel:R25-11#3a721122 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_CORE_00332@rel:R25-11#3a721122
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7b5a5cd82026-09-30
  • R19-11rel:R19-11#1351fbd62026-10-14
  • R20-11rel:R20-11#29432cbf2026-10-14
  • R21-11rel:R21-11#5f5d2ce12026-10-14
  • R22-11rel:R22-11#5dc081682026-10-14
  • R23-11rel:R23-11#377e18d72026-10-14
  • R24-11rel:R24-11#3361542e2026-10-14
  • R25-11rel:R25-11#3a7211222026-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_CORE_00325] Upstream: RS_AP_00130

Future & operator= (Future &&other) noexcept;

Move assign from another instance. This function shall behave the same as the corresponding std::future function.

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
otherthe other instance

Rückgabewert

TypBeschreibung
Future &*this

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

Record
AUTOSAR/AP/record/SWS_CORE_00325
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00325@rel:R25-11#40396b95
Content hash
40396b95
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00325
Status: valid/unmigrated Version: rel:R25-11#aaf376df 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_CORE_00325@rel:R25-11#aaf376df
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#13e5b1852026-09-30
  • R19-11rel:R19-11#93353d342026-10-14
  • R20-11rel:R20-11#3bdb585e2026-10-14
  • R21-11rel:R21-11#a4d956ef2026-10-14
  • R22-11rel:R22-11#9c832db92026-10-14
  • R23-11rel:R23-11#c2dbc2b52026-10-14
  • R24-11rel:R24-11#5c0627a82026-10-14
  • R25-11rel:R25-11#aaf376df2026-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_CORE_00335] Upstream: RS_AP_00130

Future & operator= (const Future &)=delete;

Copy assignment operator shall be disabled

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future

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

Record
AUTOSAR/AP/record/SWS_CORE_00335
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00335@rel:R25-11#d802ebfe
Content hash
d802ebfe
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00335
Status: valid/unmigrated Version: rel:R25-11#9bdef4fb 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_CORE_00335@rel:R25-11#9bdef4fb
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b9b4dead2026-09-30
  • R19-11rel:R19-11#3780a25f2026-10-14
  • R20-11rel:R20-11#7f6cf9742026-10-14
  • R21-11rel:R21-11#7f6cf9742026-10-14
  • R22-11rel:R22-11#b8baf3702026-10-14
  • R23-11rel:R23-11#e09e21542026-10-14
  • R24-11rel:R24-11#bb38b8c92026-10-14
  • R25-11rel:R25-11#9bdef4fb2026-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

函数 then [SWS_CORE_00331] Upstream: RS_AP_00130

template <typename F> auto then (F &&func) noexcept -> Future< <see below> >;

Create a new Future with the content returned by func when passed the Result of this Future. The callable func may be called in the context of this call or in the context of • Promise::set_result(const T&) • Promise::set_result(T&&) • Promise::SetError(E&&) • Promise::SetError(const E&) or somewhere else.

valid() ==FALSE on the original Future object immediately after it returns.

The Callable input argument func takes a Result<T,E> object as parameter. This will be the Result obtained via GetResult() from the Future instance itself, on which then(...) is being called. The Result is passed to func as an rvalue expression.

The return type of then(...) depends on the return type of func (aka continuation).

Let U be the return type of the continuation (i.e. a type equivalent to std::invoke_result_ t<std::decay_t<F>,Result<T,E>>). Return type deduction: • If U is Future<T2,E2> for some types T2, E2, then the return type of then(...) is Future<T2,E2>. This is known as implicit Future unwrapping. • If U is Result<T2,E2> for some types T2, E2, then the return type of then(...) is Future<T2,E2>. This is known as implicit Result unwrapping. • Otherwise it is Future<U,E> Continuations that are registered with then(...) are registered in the Future F that then (...) returns. No such continuation shall be executed after the destructor of the Future F returns. A continuation that is already being executed shall run to completion.

Note: that means that the destructor of Future might block until the currently running continuation has been completed.

The continuation shall not throw, except for the purpose of implementing a Violation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 771d2952e4cb 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

成员函数 then 用于链接异步计算,并将可调用对象 func 作为延续(Continuation)注册到 ara::core::Future 的实例上 [SWS_CORE_00331]。在调用返回后,原本的 Future 失效(valid() == false)。调用目标接收通过 GetResult() 获取的实例结果作为类型为 Result<T, E> 的右值传递 [SWS_CORE_00331]。

then 的返回类型取决于 Continuation [SWS_CORE_00331] 的返回类型 U:

  • 如果 func 返回 Future<T2, E2>,则隐式进行 Future 解包到 Future<T2, E2> [SWS_CORE_00331]。
  • 如果 func 返回 Result<T2, E2>,则隐式进行 Result 解包到 Future<T2, E2> [SWS_CORE_00331]。
  • 在所有其他情况下,返回类型为 Future<U, E> [SWS_CORE_00331]。

func 的执行可以在调用 then 的上下文中同步发生、在 Promise::set_result 或 Promise::SetError 的上下文中发生,或者在其他上下文中发生 [SWS_CORE_00331]。该调用被指定为非线程安全。Continuation 在返回的 Future 中注册;在其析构函数返回后,不得再执行任何 Continuation,而已经在运行的执行则会运行至结束 [SWS_CORE_00331]。

不存在标准化的错误码 [SWS_CORE_00331]。错误必须由用户捕获并在返回的 Result 或 Future 中作为错误码传递,因为异常不得离开 Continuation。在无效的 Future 上调用会触发 FutureInvalidViolation;如果 Continuation 抛出异常,会导致 FutureContinuationHasThrownViolation [SWS_CORE_00331]。

对于在显式执行上下文中的执行,可以使用带有 Executor 的重载 [SWS_CORE_00337],而对于没有返回值的操作,则使用 void 特化 [SWS_CORE_06231]。

本使用说明由 AI 基于 AUTOSAR Adaptive R25-11 规范生成。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid ==FALSE ) lation FutureContinua- If the continuation throws an exception tionHasThrownVio- lation

Parameter (in)

ParameterBeschreibung
funca callable to register

Rückgabewert

TypBeschreibung
Future< <see below> >a new Future instance for the result of the continuation

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.
Hinweise: Users who need to propagate information from closures’ exceptions should translate them to an error and return an ara::core::Result or ara::core::Future from the continuation with the error stored in it. Exceptions can be used within the continuation, however if they do not realize a Violation, they must not escape the continuation.

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

Record
AUTOSAR/AP/record/SWS_CORE_00331
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00331@rel:R25-11#544194fe
Content hash
544194fe
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00331
Status: valid/unmigrated Version: rel:R25-11#7ccfcd36 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_CORE_00331@rel:R25-11#7ccfcd36
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#07a6189e2026-09-30
  • R19-11rel:R19-11#ab04e9222026-10-14
  • R20-11rel:R20-11#99557d6e2026-10-14
  • R21-11rel:R21-11#3a933d6a2026-10-14
  • R22-11rel:R22-11#008dba362026-10-14
  • R23-11rel:R23-11#4907cfa12026-10-14
  • R24-11rel:R24-11#2eae23502026-10-14
  • R25-11rel:R25-11#7ccfcd362026-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

函数 then [SWS_CORE_00337] Upstream: RS_AP_00130

template <typename F, typename ExecutorT> auto then (F &&func, ExecutorT &&executor) noexcept -> Future< <see below> >;

Create a new Future with the content returned by func when passed the Result of this Future. func is called in the context of the provided execution context executor. valid() == false on the original Future object immediately after it returns. The Callable input argument "func" takes a Result<T,E> object as parameter. This will be the Result obtained via GetResult from the Future instance itself, on which .then() is being called. The Result is passed to func as an rvalue expression. The return type of then depends on the return type of func (aka continuation). Let U be the return type of the continuation (i.e. a type equivalent to std::invoke_result_ t<std::decay_t<F>,Result<T,E>>). • If U is Future<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Future unwrapping. • If U is Result<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Result unwrapping. • Otherwise it is Future<U,E>. Continuations that are registered with Future::then() are registered in the Future F that Future::then() returns. No such continuation shall be executed after the destructor of the Future F returns. A continuation that is already being executed shall run to completion. Note: that means that the destructor of Future might block until the currently running continuation has been completed. The continuation shall not throw, except for the purpose of implementing a Violation. Note: Exceptions can be used within the continuation, however if they do not realize a Violation, they must not escape the continuation. Note: Users who need to propagate information from closures’ exceptions should translate them to an error and return an ara::core::Result or ara::core::Future from the continuation with the error stored in it.

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

用法与语义

方法 then 注册一个 Continuation(func),一旦当前 Future 实例的结果可用,该 Continuation 就会在传入的 executor 上下文中异步执行 [SWS_CORE_00337]。可调用单元将实例的结果作为类型为 Result<T,E> 的右值表达式接收 [SWS_CORE_00337]。返回类型取决于 Continuation 的返回类型 U:

  • 如果 Continuation 返回 Future<T2,E2>,则会隐式解包为 Future<T2,E2> [SWS_CORE_00337]。
  • 如果 Continuation 返回 Result<T2,E2>,它同样会隐式解析为 Future<T2,E2> [SWS_CORE_00337]。
  • 在所有其他情况下,调用返回 Future<U,E> [SWS_CORE_00337]。

并发性与生命周期

在方法调用返回后,原始的 Future 实例立即失效(valid() == false)[SWS_CORE_00337]。该函数被声明为非线程安全 [SWS_CORE_00337]。注册的 Continuation 在新返回的 Future 中进行管理。在其析构函数到期后,不得再启动任何 Continuation;已经在运行的执行将被完成,因此析构函数可能会阻塞 [SWS_CORE_00337]。

错误处理与交互

未定义标准化的错误代码 [SWS_CORE_00337]。在无效实例上调用会引发违规 FutureInvalidViolation [SWS_CORE_00337]。如果 Continuation 抛出异常,会导致 FutureContinuationHasThrownViolation;因此必须捕获异常并通过 ara::core::Result 或 ara::core::Future 作为错误传递 [SWS_CORE_00337]。与没有执行上下文的重载 [SWS_CORE_00331] 相比,此变体强制在传入的执行器上执行;对于 void 结果类型,存在类似的特化 [SWS_CORE_06237]。

本使用说明基于 AUTOSAR Adaptive R25-11 规范。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid ==FALSE ) lation FutureContinua- If the continuation throws an exception tionHasThrownVio- lation

Template-Parameter

ParameterBeschreibung
FExecutorTthe type of the func argument the type of the executor argument

Parameter (in)

ParameterBeschreibung
funca callable to register
executorthe execution context in which to execute func

Rückgabewert

TypBeschreibung
Future< <see below> >a new Future instance for the result of the continuation

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_CORE_00337
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00337@rel:R25-11#1bcee882
Content hash
1bcee882
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00337
Status: valid/unmigrated Version: rel:R25-11#749fe9dc Versionshistorie & Revisions (1 transition, 7 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_00337@rel:R25-11#749fe9dc
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#1e610dd32026-09-30
  • R20-11rel:R20-11#12659cf92026-10-14
  • R21-11rel:R21-11#ecfba0d52026-10-14
  • R22-11rel:R22-11#d94fa7762026-10-14
  • R23-11rel:R23-11#8b664ec92026-10-14
  • R24-11rel:R24-11#853472252026-10-14
  • R25-11rel:R25-11#749fe9dc2026-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

函数 valid [SWS_CORE_00327] Upstream: RS_AP_00130

bool valid () const noexcept;

Checks if the Future is valid, i.e. if it has a shared state.

This function shall behave the same as the corresponding std::future function.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0fe78ab97a32 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步查询函数 valid() 在无参数的情况下检查 ara::core::Future 实例是否拥有共享状态(Shared State)并因此可用 [SWS_CORE_00327]。如果对象处于就绪状态,它将返回 true;如果不存在共享状态,则返回 false [SWS_CORE_00327]。该行为与标准函数 std::future::valid 一致,并且同样适用于模板特化 ara::core::Future<void, E> [SWS_CORE_06227]。

该函数被声明为 noexcept,视为异常安全(exception safe),并被明确指定为线程安全(thread-safe)[SWS_CORE_00327]。它本身不会触发错误代码或异常,因此可以安全地用于状态检查 [SWS_CORE_00327]。

在与 Future 的其他方法交互时,有效性检查至关重要,因为调用操作(如 wait() [SWS_CORE_00328] 或 is_ready() [SWS_CORE_00332])在无效状态(valid() == false)下会引发 FutureInvalidViolation。先前有效的 Future 在其结果通过 get() [SWS_CORE_00326] 或 GetResult() [SWS_CORE_00336] 被消费,或通过 then() [SWS_CORE_00331]、[SWS_CORE_00337] 注册了进一步处理后,会自动变为无效。

本文档由 AI 创建并用作参考指南。仅所链接的 AUTOSAR 规范具有约束力。

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
bool• TRUE: the Future is usable • FALSE: the Future is NOT usable

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

Record
AUTOSAR/AP/record/SWS_CORE_00327
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00327@rel:R25-11#5d7a0c54
Content hash
5d7a0c54
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00327
Status: valid/unmigrated Version: rel:R25-11#67ea8cce 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_CORE_00327@rel:R25-11#67ea8cce
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#d314fbc32026-09-30
  • R19-11rel:R19-11#80d78b532026-10-14
  • R20-11rel:R20-11#b7f4e1552026-10-14
  • R21-11rel:R21-11#688e791c2026-10-14
  • R22-11rel:R22-11#4e92dc072026-10-14
  • R23-11rel:R23-11#91718d0e2026-10-14
  • R24-11rel:R24-11#1c24bacf2026-10-14
  • R25-11rel:R25-11#67ea8cce2026-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

函数 wait [SWS_CORE_00328] Upstream: RS_AP_00130

void wait () const noexcept;

Wait for a value or an error to be available.

This function shall behave the same as the corresponding std::future function

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9635b0074677 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::core::Future 的成员函数 wait 同步阻塞调用线程,直到异步操作的结果值或错误可用 [SWS_CORE_00328]。该函数不接受任何参数,不提供返回值,并且根据规范其行为与来自 std::future 的相应函数类似 [SWS_CORE_00328]。相同的行为适用于模板特化 ara::core::Future<void, E> [SWS_CORE_06228]。

关于错误处理和并发性,定义了以下规范:

  • 错误条件:如果 Future 对象无效(valid == FALSE),则存在 FutureInvalidViolation [SWS_CORE_00328]、[SWS_CORE_06228]。尽管如此,该函数仍被声明为 noexcept 并归类为异常安全(exception safe)[SWS_CORE_00328]。
  • 线程安全性:该调用被明确归类为not thread-safe[SWS_CORE_00328]。在没有外部同步的情况下并发访问同一个 Future 对象是不被允许的。

在与相关接口配合使用时,建议在调用前使用 is_ready 进行检查 [SWS_CORE_00332]、[SWS_CORE_06232]:若其返回 true,则调用 wait 保证不再阻塞。若需要有时间限制的阻塞过程而非无限期等待,则可选择带有相对持续时间的 wait_for [SWS_CORE_00329]、[SWS_CORE_06229] 以及带有绝对时间点的 wait_until [SWS_CORE_00330]、[SWS_CORE_06230]。

本使用说明基于 AUTOSAR Adaptive R25-11 规范自动生成。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid ==FALSE ) lation

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CORE_00328
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00328@rel:R25-11#30527c24
Content hash
30527c24
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00328
Status: valid/unmigrated Version: rel:R25-11#7d1caea0 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_CORE_00328@rel:R25-11#7d1caea0
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#71020ccc2026-09-30
  • R19-11rel:R19-11#1457e28d2026-10-14
  • R20-11rel:R20-11#7259d3062026-10-14
  • R21-11rel:R21-11#82e85c2e2026-10-14
  • R22-11rel:R22-11#63ca481a2026-10-14
  • R23-11rel:R23-11#7b23f9cb2026-10-14
  • R24-11rel:R24-11#4301d6592026-10-14
  • R25-11rel:R25-11#7d1caea02026-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

函数 wait_for [SWS_CORE_00329] Upstream: RS_AP_00130

template <typename Rep, typename Period> FutureStatus wait_for (const std::chrono::duration< Rep, Period > &timeoutDuration) const noexcept;

Wait for the timeoutDuration or until a value or an error is available.

This function shall behave the same as the corresponding std::future function.

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

使用

类 ara::core::Future 的成员函数 wait_for 阻塞调用线程,最多阻塞传入的时间段 timeoutDuration 或直到共享状态中就绪结果值或错误 [SWS_CORE_00329]。其行为与来自 std::future 的对应函数相对应 [SWS_CORE_00329]。作为返回值,它返回一个 FutureStatus [SWS_CORE_00329],用于指示共享状态是否可用(kReady)或指定的等待时间是否已超时(kTimeout)[SWS_CORE_00361]。

错误处理与边界条件

该函数被声明为 noexcept 并被指定为异常安全(exception safe)[SWS_CORE_00329]。若 Future 对象无效(valid == FALSE),则存在形式为 FutureInvalidViolation 的违规 [SWS_CORE_00329]。解释:由于不允许抛出 C++ 异常,此类违规在平台端可能会被作为致命运行时错误处理。 问题 Q-2f22a07f6e143856 (未决)

并发性与交互

该操作被归类为 not thread-safe [SWS_CORE_00329];因此,对同一实例的并发访问需要外部同步。该语义和签名同样适用于模板特化 ara::core::Future<void, E> [SWS_CORE_06229]。与 std::future_status 不同,枚举类型 FutureStatus 中不存在用于 deferred 的项 [SWS_CORE_00361]。

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

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid ==FALSE ) lation

Parameter (in)

ParameterBeschreibung
timeoutDurationmaximal duration to wait for

Rückgabewert

TypBeschreibung
FutureStatusStatus that indicates whether the timeoutDuration expired or if a value is available

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

Record
AUTOSAR/AP/record/SWS_CORE_00329
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00329@rel:R25-11#5b850ab9
Content hash
5b850ab9
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00329
Status: valid/unmigrated Version: rel:R25-11#bb164066 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_CORE_00329@rel:R25-11#bb164066
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#669e52732026-09-30
  • R19-11rel:R19-11#34429cdd2026-10-14
  • R20-11rel:R20-11#6e3fcfd92026-10-14
  • R21-11rel:R21-11#6e3fcfd92026-10-14
  • R22-11rel:R22-11#4c259d672026-10-14
  • R23-11rel:R23-11#ec6d12432026-10-14
  • R24-11rel:R24-11#adb812622026-10-14
  • R25-11rel:R25-11#bb1640662026-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

函数 wait_until [SWS_CORE_00330] Upstream: RS_AP_00130

template <typename Clock, typename Duration> FutureStatus wait_until (const std::chrono::time_point< Clock, Duration > &deadline) const noexcept;

Wait until the deadline or until a value or an error is available.

This function shall behave the same as the corresponding std::future function.

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

成员函数 wait_until 阻塞调用线程,直到到达指定的绝对时间点 deadline 或 ara::core::Future 提供结果或错误 [SWS_CORE_00330]。其行为参考 std::future 的对应函数 [SWS_CORE_00330]。

作为返回值,该函数提供一个 FutureStatus [SWS_CORE_00330]。该枚举类型通过状态 kReady 指示共享状态已就绪(值或错误可用),或通过 kTimeout 指示截止期限已过且无结果 [SWS_CORE_00361]。FutureStatus 中不存在类似于 std::future_status::deferred 的状态 [SWS_CORE_00361]。

在错误处理和异常安全性方面,该函数被指定为异常安全(exception safe)和 noexcept [SWS_CORE_00330]。但若在无效实例上调用该函数(valid == FALSE),则存在形式为 FutureInvalidViolation 的违规 [SWS_CORE_00330]。

关于并发性,wait_until 被归类为非线程安全(not thread-safe)[SWS_CORE_00330]。因此,对同一 ara::core::Future 对象的并行访问必须进行外部同步。相同的语义和签名适用于特化 ara::core::Future<void, E> [SWS_CORE_06230]。

本文由 AI 生成,仅供参考。一切以规范为准。

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid ( valid ==FALSE ) lation

Parameter (in)

ParameterBeschreibung
deadlinelatest point in time to wait

Rückgabewert

TypBeschreibung
FutureStatusstatus that indicates whether the deadline was reached or if a value is available

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

Record
AUTOSAR/AP/record/SWS_CORE_00330
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00330@rel:R25-11#f865f01a
Content hash
f865f01a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00330
Status: valid/unmigrated Version: rel:R25-11#00db6175 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_CORE_00330@rel:R25-11#00db6175
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#f662b2c42026-09-30
  • R19-11rel:R19-11#a84101962026-10-14
  • R20-11rel:R20-11#4f8fd4042026-10-14
  • R21-11rel:R21-11#0fe1ad9c2026-10-14
  • R22-11rel:R22-11#6ef3c1042026-10-14
  • R23-11rel:R23-11#872aa1602026-10-14
  • R24-11rel:R24-11#412256922026-10-14
  • R25-11rel:R25-11#00db61752026-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

函数 ~Future [SWS_CORE_00333] Upstream: RS_AP_00130

~Future () noexcept;

Destructor for Future objects. Abandons any shared state

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future
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_CORE_00333
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00333@rel:R25-11#f06a4188
Content hash
f06a4188
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00333
Status: valid/unmigrated Version: rel:R25-11#2689e3e8 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_CORE_00333@rel:R25-11#2689e3e8
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#16f70bc12026-09-30
  • R19-11rel:R19-11#42ac89202026-10-14
  • R20-11rel:R20-11#8f4a235f2026-10-14
  • R21-11rel:R21-11#eccb21be2026-10-14
  • R22-11rel:R22-11#58e9180f2026-10-14
  • R23-11rel:R23-11#b308517b2026-10-14
  • R24-11rel:R24-11#02a09fc62026-10-14
  • R25-11rel:R25-11#2689e3e82026-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