DEENESPTFRRUARHIKOZHNL

类 ara::core::Future< void, E >

[SWS_CORE_06221] Upstream: RS_AP_00130

template <typename E> class Future< void, E > final {...};

Specialization of class Future for "void" values. The implementation shall flag the condition: ( E != ara::core::ErrorCode ) as a compile error.

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 · 温度: 不可控 · 提示词: e943c154e07e 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持等待无返回值的异步操作完成,并提取错误状态。

类 ara::core::Future<void, E> 支持在 AUTOSAR Adaptive 中对无返回值的操作进行异步同步和错误检查 [SWS_CORE_06236]。作为不可拷贝类型,它允许等待操作完成,并以 ara::core::Result<void, E> [SWS_CORE_06236] 的形式异常安全地获取结果,或通过延续函数进行异步后续处理 [SWS_CORE_06231]。在提取结果之后,共享状态将失效,因此在没有有效状态的情况下进行后续调用构成违规 [SWS_CORE_06236]。

上下文

模板类特化 ara::core::Future<void, E> 代表 AUTOSAR Adaptive 中异步操作的接收端,该操作在成功完成时不返回任何值,而仅指示事件发生或发生了错误。根据类说明,实现必须以编译错误来响应条件 E != ara::core::ErrorCode。该类通常与填充共享状态(Shared State)的对应 ara::core::Promise 交互 [SWS_CORE_06236],并在注册延续函数时与异步执行上下文交互 [SWS_CORE_06237]。

生命周期

ara::core::Future<void, E> 的实例是纯移动语义对象:拷贝构造函数 [SWS_CORE_06234] 以及拷贝赋值运算符 [SWS_CORE_06235] 已被删除(delete)。通过默认构造函数创建的对象不具有共享状态,其行为类似于 std::future [SWS_CORE_06222]。通过移动构造 [SWS_CORE_06223] 或移动赋值 [SWS_CORE_06225],实例可以从另一个实例接管 Shared State 的所有权。

生命周期主要由 Shared State 的状态决定。通过方法 valid() 可以检查实例是否绑定到 Shared State 并因此可用 [SWS_CORE_06227]。一旦通过 GetResult() [SWS_CORE_06236] 或 get() [SWS_CORE_06226] 获取结果,或通过 then() [SWS_CORE_06231] 注册延续,Future 对象即失去其 Shared State,且 valid() 返回 false。析构函数释放剩余的共享状态 [SWS_CORE_06233]。在并发性方面,检查和销毁操作(如 valid() [SWS_CORE_06227]、is_ready() [SWS_CORE_06232] 及析构函数 [SWS_CORE_06233])是线程安全的,而改变状态的操作(如 GetResult() [SWS_CORE_06236]、get() [SWS_CORE_06226] 以及等待函数 [SWS_CORE_06228])不是线程安全的。

future_states Ungueltig 无效 (valid() == false) Ausstehend 有效 / 待决 (valid() == true, is_ready() == false) Ungueltig->Ausstehend Move-Konstruktion / Zuweisung Ausstehend->Ungueltig then() Bereit 有效 / 就绪 (valid() == true, is_ready() == true) Ausstehend->Bereit Promise setzt Wert / Fehler Bereit->Ungueltig GetResult() / get() Bereit->Ungueltig then()

状态图:ara::core::Future<void, E> 的状态转换与有效性。来源:[SWS_CORE_06222], [SWS_CORE_06226], [SWS_CORE_06227], [SWS_CORE_06231], [SWS_CORE_06232], [SWS_CORE_06233], [SWS_CORE_06236]

使用路径

在同步使用路径中,使用者等待异步操作完成。通过 is_ready() 可以低阻塞地查询是否存在值或错误 [SWS_CORE_06232]。或者,可以通过 wait() 进行阻塞式等待 [SWS_CORE_06228],或通过 wait_for() [SWS_CORE_06229] 和 wait_until() [SWS_CORE_06230] 进行限时等待。若结果可用,优选通过 GetResult() 异常安全地进行值查询,从而返回 ara::core::Result<void, E> [SWS_CORE_06236]。

在异步路径中,方法 then() 允许注册一个延续函数(Continuation),该函数在结果可用时立即执行 [SWS_CORE_06231]。此时可以可选地传入执行上下文(Executor)[SWS_CORE_06237]。Continuation 将 Result<void, E> 作为右值接收。then() 的返回类型会自动解包嵌套的 Future 或 Result 类型(Unwrapping)[SWS_CORE_06231]。

通过 GetResult 同步检索结果应用FutureSharedStatevalid()trueis_ready()检查状态true(结果或错误已就绪)trueGetResult()std::move(Ergebnis)Result<void, E>将共享状态置为无效(valid() == false)Result<void, E>

时序图:通过 GetResult 进行结果查询的同步流程。来源:[SWS_CORE_06227], [SWS_CORE_06228], [SWS_CORE_06232], [SWS_CORE_06236]

错误场景

若在无效实例(valid() == false)上调用依赖状态的操作(例如 GetResult()、is_ready()、wait()、wait_for()、wait_until() 或 then()),则存在违反前置条件的情况,该情况被视为 FutureInvalidViolation 处理 [SWS_CORE_06228], [SWS_CORE_06229], [SWS_CORE_06230], [SWS_CORE_06231], [SWS_CORE_06232], [SWS_CORE_06236], [SWS_CORE_06237]。在无效实例上调用 get() 时,将改为触发带有错误码 kNoState 的 FutureException [SWS_CORE_06226];在禁用 C++ 异常时,get() 不参与重载决议 [SWS_CORE_06226]。

若对应的 Promise 已被销毁或已脱离共享状态,且未设置结果或显式错误,则根据 [SWS_CORE_00400] 将错误码 FutureErrc::kBrokenPromise 存入 Shared State [SWS_CORE_06226], [SWS_CORE_06236]。该错误码由 GetResult() 作为 Result<void, E> 中的错误返回 [SWS_CORE_06236]。若在 then() 中注册的 Continuation 抛出未实现违规的异常,则会导致 FutureContinuationHasThrownViolation [SWS_CORE_06231], [SWS_CORE_06237]。

本指南仅基于 Release R25-11 中针对 ara::core::Future<void, E> 的 AUTOSAR 规范。

成员图

类图

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

G nara__core__Future__void__E__740 Future< void, E > + 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; SWS_CORE_06222
Future (Future &&other) noexcept; SWS_CORE_06223
Future (const Future &other)=delete; SWS_CORE_06234
~Future 函数

Destructor for Future objects. Abandons any shared state

~Future () noexcept;

方法

get 函数

Returns nothing. This function shall behave the same as the corresponding std::future function. Part of the behavior taken from the std::future is that after a call to this function the Future is not valid anymore (valid() == false). ≙ std::future

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

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. Part of the behavior taken from Future::get() is that after a call to this function the Future is not valid anymore (valid() == false).

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

Return whether the asynchronous operation has finished. If this function returns true, get(), Get Result() and the wait calls are guaranteed not to block.

bool is_ready () const noexcept;
then 函数 2

Create a new Future with the content returned by func when passed the Result of this Future. func may be called in the context of this call or in the context of Promise::set_value() or Promise::SetError() or somewhere else. valid() == false on the original future object immediately after it returns. The Callable input argument "func" takes a Result<void,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<void,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. ≙ std::invoke_result_

重载 then 2
template <typename F> auto then (F &&func) noexcept -> Future< <see below> >; SWS_CORE_06231
template <typename F, typename ExecutorT> auto then (F &&func, ExecutorT &&executor) noexcept -> Future< <see below> >; SWS_CORE_06237
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. This function shall behave the same as the corresponding std::future function ≙ std::future

void wait () const noexcept;
wait_for 函数

Wait for the given period, or until a value or an error is available. This function shall behave the same as the corresponding std::future function ≙ std::future

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

Wait until the given time, or until a value or an error is available. This function shall behave the same as the corresponding std::future function. ≙ std::future

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_06225
Future & operator= (const Future &other)=delete; SWS_CORE_06235

方法文档

函数 Future [SWS_CORE_06222] Upstream: RS_AP_00130

Future () noexcept;

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< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

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

Record
AUTOSAR/AP/record/SWS_CORE_06222
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06222@rel:R25-11#8022b8d7
Content hash
8022b8d7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06222
Status: valid/unmigrated Version: rel:R25-11#5a060501 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_06222@rel:R25-11#5a060501
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#1afcba652026-09-30
  • R19-11rel:R19-11#0daa41512026-10-14
  • R20-11rel:R20-11#2b96cd1f2026-10-14
  • R21-11rel:R21-11#2b96cd1f2026-10-14
  • R22-11rel:R22-11#769923512026-10-14
  • R23-11rel:R23-11#5dfa683d2026-10-14
  • R24-11rel:R24-11#5c2585642026-10-14
  • R25-11rel:R25-11#5a0605012026-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_06223] 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< void, E >
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_06223
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06223@rel:R25-11#5a7f27dd
Content hash
5a7f27dd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06223
Status: valid/unmigrated Version: rel:R25-11#d8ab302b 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_06223@rel:R25-11#d8ab302b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#c4ca9e912026-09-30
  • R19-11rel:R19-11#a14b593d2026-10-14
  • R20-11rel:R20-11#29b853f02026-10-14
  • R21-11rel:R21-11#29b853f02026-10-14
  • R22-11rel:R22-11#0b366b7e2026-10-14
  • R23-11rel:R23-11#4e1158ee2026-10-14
  • R24-11rel:R24-11#43ec03e42026-10-14
  • R25-11rel:R25-11#d8ab302b2026-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_06234] Upstream: RS_AP_00130

Future (const Future &other)=delete;

Copy constructor shall be disabled

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >

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

Record
AUTOSAR/AP/record/SWS_CORE_06234
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06234@rel:R25-11#87eccef5
Content hash
87eccef5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06234
Status: valid/unmigrated Version: rel:R25-11#56462c5d 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_06234@rel:R25-11#56462c5d
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#f81e62902026-09-30
  • R19-11rel:R19-11#544640f62026-10-14
  • R20-11rel:R20-11#d96a22e02026-10-14
  • R21-11rel:R21-11#ea4dbae52026-10-14
  • R22-11rel:R22-11#302289e52026-10-14
  • R23-11rel:R23-11#8c086a182026-10-14
  • R24-11rel:R24-11#7c2e887e2026-10-14
  • R25-11rel:R25-11#56462c5d2026-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_06236] Upstream: RS_AP_00130

Result< void, E > GetResult () noexcept(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. Part of the behavior taken from Future::get() is that after a call to this function the Future is not valid anymore (valid() == false).

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

Rückgabewert

TypBeschreibung
Result< void, E >a 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: • explicit setting of the Error via Promise::SetError / Promise::Set Result or • 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_06236
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06236@rel:R25-11#f3a31d86
Content hash
f3a31d86
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06236
Status: valid/unmigrated Version: rel:R25-11#932914cb 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_06236@rel:R25-11#932914cb
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7184bdc92026-09-30
  • R19-11rel:R19-11#541daac72026-10-14
  • R20-11rel:R20-11#3adb03532026-10-14
  • R21-11rel:R21-11#3adb03532026-10-14
  • R22-11rel:R22-11#4366d27f2026-10-14
  • R23-11rel:R23-11#f033d7132026-10-14
  • R24-11rel:R24-11#243860772026-10-14
  • R25-11rel:R25-11#932914cb2026-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_06226] Upstream: RS_AP_00130

void get () noexcept(false);

Returns nothing. This function shall behave the same as the corresponding std::future function. Part of the behavior taken from the std::future is that after a call to this function the Future is not valid anymore (valid() == false).

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

特化 ara::core::Future<void, E> 的成员函数 get 用于等待无返回值([SWS_CORE_06226])的异步操作的结果。其行为类似于 std::future 的相应函数,并阻塞调用方直至结果或错误就绪([SWS_CORE_06226]、[SWS_CORE_00336])。调用后,Future 实例将失效,使得 valid() == false 成立([SWS_CORE_06226])。

该函数被声明为非异常安全(not exception safe)([SWS_CORE_06226])。如果关联的 Promise 中存有错误,则会引发相应的异常([SWS_CORE_06226])。如果共享状态被提前放弃,则会发生符合 [SWS_CORE_00400] 的错误码 kBrokenPromise([SWS_CORE_06226])。如果在已经无效的实例上执行 get,该函数将抛出带有错误码 kNoState 的 FutureException([SWS_CORE_06226])。

关于并发性,该方法不是线程安全的(not thread-safe)([SWS_CORE_06226])。因此,对同一对象的并发访问需要外部同步。此外,如果编译器工具链中禁用了 C++ 异常,该函数将不参与重载解析([SWS_CORE_06226])。

在与相关函数的协作中,[SWS_CORE_00332](is_ready)确保在操作已完成的情况下 get 保证不会阻塞。对于没有异常的上下文,AUTOSAR 提供了 [SWS_CORE_00336](GetResult)作为替代方案,该方案通过结果类型报告错误,而不是抛出异常。

本段文本由人工智能生成,仅供参考;具有约束力的是 AUTOSAR 规范。

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

Rückgabewert

TypBeschreibung
None

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 in case 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_06226
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06226@rel:R25-11#1e788005
Content hash
1e788005
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06226
Status: valid/unmigrated Version: rel:R25-11#6ad2ffae 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_06226@rel:R25-11#6ad2ffae
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#40fe52062026-09-30
  • R19-11rel:R19-11#877183822026-10-14
  • R20-11rel:R20-11#561b11012026-10-14
  • R21-11rel:R21-11#cd0d4bbb2026-10-14
  • R22-11rel:R22-11#41a0b49a2026-10-14
  • R23-11rel:R23-11#2c6048102026-10-14
  • R24-11rel:R24-11#2f0d210c2026-10-14
  • R25-11rel:R25-11#6ad2ffae2026-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_06232] Upstream: RS_AP_00130

bool is_ready () const noexcept;

Return whether the asynchronous operation has finished. If this function returns true, get(), Get Result() and the wait calls are guaranteed not to block.

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns false) lation

Rückgabewert

TypBeschreibung
booltrue if the Future contains a value or an error, false otherwise

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

Record
AUTOSAR/AP/record/SWS_CORE_06232
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06232@rel:R25-11#d48dfaeb
Content hash
d48dfaeb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06232
Status: valid/unmigrated Version: rel:R25-11#5186dad5 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_06232@rel:R25-11#5186dad5
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#4784afca2026-09-30
  • R19-11rel:R19-11#b80f30db2026-10-14
  • R20-11rel:R20-11#e1d9ba9b2026-10-14
  • R21-11rel:R21-11#6a9c97832026-10-14
  • R22-11rel:R22-11#d2f71e3d2026-10-14
  • R23-11rel:R23-11#26d4877a2026-10-14
  • R24-11rel:R24-11#7af5dd2e2026-10-14
  • R25-11rel:R25-11#5186dad52026-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_06225] 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< void, E >
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_06225
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06225@rel:R25-11#e0149443
Content hash
e0149443
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06225
Status: valid/unmigrated Version: rel:R25-11#9232ee22 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_06225@rel:R25-11#9232ee22
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#354308df2026-09-30
  • R19-11rel:R19-11#7ddd3a9d2026-10-14
  • R20-11rel:R20-11#309f3c9c2026-10-14
  • R21-11rel:R21-11#8d4849c42026-10-14
  • R22-11rel:R22-11#9833c73f2026-10-14
  • R23-11rel:R23-11#b37e21992026-10-14
  • R24-11rel:R24-11#9232ee222026-10-14
  • R25-11rel:R25-11#9232ee222026-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_06235] Upstream: RS_AP_00130

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

Copy assignment operator shall be disabled

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >

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

Record
AUTOSAR/AP/record/SWS_CORE_06235
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06235@rel:R25-11#349e881a
Content hash
349e881a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06235
Status: valid/unmigrated Version: rel:R25-11#2ab3479c 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_06235@rel:R25-11#2ab3479c
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7aa2f7952026-09-30
  • R19-11rel:R19-11#e583d7bd2026-10-14
  • R20-11rel:R20-11#d21de51e2026-10-14
  • R21-11rel:R21-11#d21de51e2026-10-14
  • R22-11rel:R22-11#31fde6ef2026-10-14
  • R23-11rel:R23-11#de56c2ed2026-10-14
  • R24-11rel:R24-11#fd4c55142026-10-14
  • R25-11rel:R25-11#2ab3479c2026-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_06231] 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. func may be called in the context of this call or in the context of Promise::set_value() or Promise::SetError() or somewhere else. valid() == false on the original future object immediately after it returns. The Callable input argument "func" takes a Result<void,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<void,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 · 温度: 不可控 · 提示词: 161f9bad96ab 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 then 在 ara::core::Future<void, E> 实例上注册后续操作(Continuation func)[SWS_CORE_06231]。该可调用对象将操作结果作为类型为 Result<void, E> 的右值表达式接收,该表达式在内部通过 GetResult 提供 [SWS_CORE_06231]。对 func 的调用可以在 then 的上下文中同步发生,也可以在 Promise::set_value()、Promise::SetError() 的上下文中或在其他位置异步发生 [SWS_CORE_06231]。

在 then 返回后,原始 Future 立即失效(valid() == false)[SWS_CORE_06231]。返回类型会自适应 Continuation 的返回类型 U:

  • 如果 func 返回 Future<T2, E2>,则会进行隐式解包,且 then 返回 Future<T2, E2> [SWS_CORE_06231]。
  • 如果 func 返回 Result<T2, E2>,它同样会被隐式解包为 Future<T2, E2> [SWS_CORE_06231]。
  • 在所有其他情况下,返回类型为 Future<U, E> [SWS_CORE_06231]。

错误处理与边界条件

规范未为该函数指定标准化错误码 [SWS_CORE_06231]。该方法被声明为 noexcept,但定义了两个违规(Violations):

  • FutureInvalidViolation:当在无效的 Future 上调用该方法时发生(如果 valid() 返回 false)[SWS_CORE_06231]。
  • FutureContinuationHasThrownViolation:当 Continuation 抛出未实现 Violation 的异常时发生 [SWS_CORE_06231]。Continuation 中的错误必须改为打包到 Result 或 Future 中返回 [SWS_CORE_06231]。

并发性与交互

该方法不是线程安全的(not thread-safe)[SWS_CORE_06231]。在返回的 Future 的析构函数返回后,将不再执行任何已注册的 Continuation;但已经在运行的执行会被完整执行完毕,因此析构函数可能会阻塞 [SWS_CORE_06231]。[SWS_CORE_06231] 适用于 Future<void, E>,而 [SWS_CORE_00331] 描述了针对定型 Future 的变体 Future<T, E>,[SWS_CORE_06237] 则为带有显式 Executor 的重载。

此文本由 AI 基于 AUTOSAR 规范生成。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns 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.

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

Record
AUTOSAR/AP/record/SWS_CORE_06231
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06231@rel:R25-11#00c527f9
Content hash
00c527f9
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06231
Status: valid/unmigrated Version: rel:R25-11#21619af0 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_06231@rel:R25-11#21619af0
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#9e67efce2026-09-30
  • R19-11rel:R19-11#b5665d0f2026-10-14
  • R20-11rel:R20-11#0cd22f812026-10-14
  • R21-11rel:R21-11#f603398f2026-10-14
  • R22-11rel:R22-11#b27b86212026-10-14
  • R23-11rel:R23-11#2173d0cf2026-10-14
  • R24-11rel:R24-11#273db5c82026-10-14
  • R25-11rel:R25-11#21619af02026-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_06237] 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<void,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<void,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 · 温度: 不可控 · 提示词: 96d3b0e93b60 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 then 在 ara::core::Future<void, E> 的实例上注册一个可调用的延续对象(Continuation)func,以便在指定的执行上下文 executor 中执行 [SWS_CORE_06237]。在 then 返回后,调用方 Future 实例立即失效,使得 valid() == false 为真 [SWS_CORE_06237]。延续对象接收原始 Future 实例的结果作为右值表达式形式的 Result<void, E> 传入 [SWS_CORE_06237]。作为返回值,该调用提供一个新的 Future 实例,其中延续对象的返回类型若为 Future<T2, E2> 或 Result<T2, E2>,则隐式解包为 Future<T2, E2>;否则返回 Future<U, E> [SWS_CORE_06237]。

关于并发性和生命周期,该函数被指定为非线程安全(not thread-safe)[SWS_CORE_06237]。延续对象注册在刚返回的新 Future 中。在该新 Future 的析构函数返回后,不得再执行任何延续对象;然而,已在执行中的延续对象会完全执行完毕,因此 Future 的析构函数可能会发生阻塞 [SWS_CORE_06237]。

该函数未声明标准化错误码,并定义为 noexcept [SWS_CORE_06237]。如果在无效的 Future 实例上调用它,则存在违规 FutureInvalidViolation [SWS_CORE_06237]。若延续对象抛出异常,则会导致违规 FutureContinuationHasThrownViolation [SWS_CORE_06237]。异常不得脱离延续对象,而是必须在需要时转换为错误值,并在 Result 或 Future 内返回 [SWS_CORE_06237]。该函数补充了无执行器变体 [SWS_CORE_06231],并构成了带值重载 [SWS_CORE_00331] 以及 [SWS_CORE_00337] 的对应项。

本使用说明由 AI 系统创建,基于 AUTOSAR 规范 R25-11。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns 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 the Callable 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_06237
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06237@rel:R25-11#b1aa4d18
Content hash
b1aa4d18
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06237
Status: valid/unmigrated Version: rel:R25-11#58e4cf50 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_06237@rel:R25-11#58e4cf50
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#e39189402026-09-30
  • R20-11rel:R20-11#5e1b7f5b2026-10-14
  • R21-11rel:R21-11#1e3cbb002026-10-14
  • R22-11rel:R22-11#e2d3ef1a2026-10-14
  • R23-11rel:R23-11#8b2f870e2026-10-14
  • R24-11rel:R24-11#27088c392026-10-14
  • R25-11rel:R25-11#58e4cf502026-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_06227] 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 · 温度: 不可控 · 提示词: 480112e5c811 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 valid() 同步检查 ara::core::Future<void, E> 的实例是否具有共享状态(Shared State)并因此可用 [SWS_CORE_06227]。根据规范,其行为类似于来自 std::future 的相应函数 [SWS_CORE_06227]。如果 Future 可用,它返回 true 作为返回值;如果不可用,则返回 false [SWS_CORE_06227]。

关于并发与错误处理,该方法被声明为 noexcept、具备异常安全性(exception safe),并被明确指定为线程安全(thread-safe)[SWS_CORE_06227]。因此,它可以安全地从并发上下文中调用。

在与其他操作的配合中,valid() 用于保障生命周期:

  • 如果在无效的 Future 对象(valid() == false)上调用诸如 wait() [SWS_CORE_06228] 或 is_ready() [SWS_CORE_00332] 之类的操作,将引发违例 FutureInvalidViolation。
  • 消费型操作会使对象失效:在调用 get() 之后,Future 将不再有效,因此后续使用 valid() 进行的检查将产生值 false [SWS_CORE_06226]。
  • 同样,通过 then() [SWS_CORE_00331] 进行转发或调用 GetResult() [SWS_CORE_00336] 都会导致原始 Future 对象立失效。

本使用说明由 AI 基于规范生成。

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
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_06227
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06227@rel:R25-11#2093c8a7
Content hash
2093c8a7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06227
Status: valid/unmigrated Version: rel:R25-11#d38a60b4 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_06227@rel:R25-11#d38a60b4
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#285420912026-09-30
  • R19-11rel:R19-11#2199fb4c2026-10-14
  • R20-11rel:R20-11#7a68b03e2026-10-14
  • R21-11rel:R21-11#a46ad2562026-10-14
  • R22-11rel:R22-11#6bc04f322026-10-14
  • R23-11rel:R23-11#bd2577342026-10-14
  • R24-11rel:R24-11#2f9de2d02026-10-14
  • R25-11rel:R25-11#d38a60b42026-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_06228] 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 · 温度: 不可控 · 提示词: 2f9ee5ecd1d4 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

特化 ara::core::Future<void, E> 的成员函数 wait 会同步阻塞调用线程,直至异步操作的结果以值或错误的形式可用 [SWS_CORE_06228]。该函数不接受任何参数,不返回任何值(void),并且规范行为类似于 std::future 的相应函数 [SWS_CORE_06228]。

关于错误处理和约束条件,适用以下规定:

  • 异常安全性与错误处理:该操作使用 noexcept 声明,并被指定为异常安全(exception safe)[SWS_CORE_06228]。如果 valid() 针对 Future 实例返回 false,则存在违规 FutureInvalidViolation [SWS_CORE_06228]。该违规的具体后果推测实现为 AUTOSAR 运行时的系统特定错误处理。 问题 Q-469e9abc947b9869 (未决)
  • 并发性:该函数被归类为非线程安全(not thread-safe)[SWS_CORE_06228]。因此,在没有外部同步的情况下并发访问同一个 Future 对象是不被允许的。

在与模块 core 其他函数的协作中,存在以下可能:

  • 可以使用线程安全方法 is_ready 预先查询操作是否已完成;在返回 true 时,wait 保证不再阻塞 [SWS_CORE_06232]。
  • 为了避免无限阻塞,提供了带有相对时长的限时函数 wait_for [SWS_CORE_06229] 以及带有绝对时间点的 wait_until [SWS_CORE_06230]。
  • 对于主模板类 ara::core::Future,同样的同步等待规定和限制适用 [SWS_CORE_00328]。

本段文本由人工智能系统整理,完全基于 AUTOSAR 规范。

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns 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_06228
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06228@rel:R25-11#57dd74bc
Content hash
57dd74bc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06228
Status: valid/unmigrated Version: rel:R25-11#24670f02 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_06228@rel:R25-11#24670f02
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#a06c2ef52026-09-30
  • R19-11rel:R19-11#4b7a7a422026-10-14
  • R20-11rel:R20-11#457c63ae2026-10-14
  • R21-11rel:R21-11#6b136de32026-10-14
  • R22-11rel:R22-11#3d7c381b2026-10-14
  • R23-11rel:R23-11#d02a0b222026-10-14
  • R24-11rel:R24-11#a383ce752026-10-14
  • R25-11rel:R25-11#24670f022026-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_06229] Upstream: RS_AP_00130

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

Wait for the given period, 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 · 温度: 不可控 · 提示词: 927a98d78cf3 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

特化 ara::core::Future<void, E> 的方法 wait_for 将调用线程同步阻塞一段最大时间跨度 timeoutDuration,或者直到结果就绪 [SWS_CORE_06229]。其语义行为与对应的标准函数 std::future::wait_for 相同 [SWS_CORE_06229]。

作为返回值,该函数提供状态 FutureStatus [SWS_CORE_06229]。该状态通过 FutureStatus::kReady 指示值或错误可用,或者通过 FutureStatus::kTimeout 指示期限已过且无结果 [SWS_CORE_00361]。未规定与 std::future_status::deferred 等效的状态 [SWS_CORE_00361]。其行为符合常规 Future 接口 [SWS_CORE_00329]。

对于该调用,在并发和错误处理方面适用以下条件:

  • 并发性:该函数被指定为非线程安全(not thread-safe)[SWS_CORE_06229]。对同一实例的并发调用必须由调用方进行保护。
  • 错误情况与异常安全性:该操作被声明为异常安全(exception safe)以及 noexcept [SWS_CORE_06229]。如果 Future 对象无效(valid() 返回 false),则存在 FutureInvalidViolation [SWS_CORE_06229]。由于 noexcept 声明,该违规可能会导致程序立即中止。 问题 Q-4f01aa6e7fbfb12d (未决)

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

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns false) lation

Parameter (in)

ParameterBeschreibung
timeoutDurationmaximal duration to wait for

Rückgabewert

TypBeschreibung
FutureStatusstatus that indicates whether the timeout hit 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_06229
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06229@rel:R25-11#f71833bb
Content hash
f71833bb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06229
Status: valid/unmigrated Version: rel:R25-11#cde767bb 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_06229@rel:R25-11#cde767bb
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#414f595f2026-09-30
  • R19-11rel:R19-11#8d512e042026-10-14
  • R20-11rel:R20-11#f89ce5282026-10-14
  • R21-11rel:R21-11#f89ce5282026-10-14
  • R22-11rel:R22-11#68d81b0f2026-10-14
  • R23-11rel:R23-11#534174642026-10-14
  • R24-11rel:R24-11#38872d6e2026-10-14
  • R25-11rel:R25-11#cde767bb2026-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_06230] 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 given time, 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 · 温度: 不可控 · 提示词: 932b0d674f17 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

特化 ara::core::Future<void, E> 的成员函数 wait_until 阻塞调用线程,直到达到指定的绝对时间点 deadline,或者值或错误可用 [SWS_CORE_06230]。该函数表现出与对应 C++ 标准函数 std::future::wait_until 相同的行为 [SWS_CORE_06230],并且具有与用于 ara::core::Future 的泛型重载相同的语义 [SWS_CORE_00330]。

类型为 FutureStatus 的返回值指示已达到期限还是值可用 [SWS_CORE_06230]。在此,状态 kReady 表示共享状态已就绪,而 kTimeout 表示共享状态在期限届满前未就绪 [SWS_CORE_00361]。FutureStatus 中不存在类似于 std::future_status::deferred 的状态 [SWS_CORE_00361]。

关于执行和边界条件,定义了以下规范:

  • 调用上下文与异常行为:该函数通过头文件 #include "ara/core/future.h" 可用,声明为 noexcept,并被指定为异常安全(exception safe)[SWS_CORE_06230]。
  • 错误状态:如果 Future 无效,即当 valid() 返回值 false 时,存在违规 FutureInvalidViolation [SWS_CORE_06230]。
  • 并发性:该操作被归类为非线程安全(not thread-safe)[SWS_CORE_06230]。

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

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

Header-Datei#include "ara/core/future.h"
Scopeclass ara::core::Future< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe
Verletzungen (Violations)FutureInvalidVio- If the Future is invalid (valid returns false) lation

Parameter (in)

ParameterBeschreibung
deadlinelatest point in time to wait

Rückgabewert

TypBeschreibung
FutureStatusstatus that indicates whether the time 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_06230
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06230@rel:R25-11#0d49688e
Content hash
0d49688e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06230
Status: valid/unmigrated Version: rel:R25-11#f458c628 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_06230@rel:R25-11#f458c628
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#eec83ed82026-09-30
  • R19-11rel:R19-11#73333c762026-10-14
  • R20-11rel:R20-11#291da1182026-10-14
  • R21-11rel:R21-11#cb6c719b2026-10-14
  • R22-11rel:R22-11#31de44c72026-10-14
  • R23-11rel:R23-11#944875602026-10-14
  • R24-11rel:R24-11#85fe57402026-10-14
  • R25-11rel:R25-11#f458c6282026-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_06233] 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< void, E >
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

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

Record
AUTOSAR/AP/record/SWS_CORE_06233
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_06233@rel:R25-11#e2961648
Content hash
e2961648
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_06233
Status: valid/unmigrated Version: rel:R25-11#7ce4899e 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_06233@rel:R25-11#7ce4899e
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#32a6e0a42026-09-30
  • R19-11rel:R19-11#e8e5d2942026-10-14
  • R20-11rel:R20-11#feb4e8682026-10-14
  • R21-11rel:R21-11#a081de932026-10-14
  • R22-11rel:R22-11#40dcc5802026-10-14
  • R23-11rel:R23-11#8b89d85f2026-10-14
  • R24-11rel:R24-11#25b460852026-10-14
  • R25-11rel:R25-11#7ce4899e2026-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