DEENESPTFRRUARHIKOZHNL

classe 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

Guia do utilizadorGERADO POR IA

Permite a recepção síncrona ou assíncrona de valores e erros a partir de uma operação concorrente.
GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: fbd974cb6be2 Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Permite a recepção síncrona ou assíncrona de valores e erros a partir de uma operação concorrente.

A classe ara::core::Future atua como um identificador receptor para o resultado de uma operação assíncrona e gerencia o acesso a um estado compartilhado [SWS_CORE_00327]. Os consumidores podem verificar o estado de forma não bloqueante, aguardar sincronicamente a conclusão ou receber o resultado sem exceções por meio de GetResult() como ara::core::Result [SWS_CORE_00336]. Como as operações de cópia são eliminadas, a posse é gerenciada de forma exclusiva e, após a recuperação do resultado ou o encaminhamento por meio de continuação, o objeto torna-se imediatamente inválido.

Contexto

A classe template ara::core::Future representa o elemento final receptor para resultados de operações assíncronas dentro da AUTOSAR Adaptive Platform. Ela permite o acesso controlado a um estado compartilhado (Shared State) que é preenchido de forma assíncrona por uma instância produtora [SWS_CORE_00327]. Conceitualmente, a classe implementa std::future do padrão C++17 ISO/IEC 14882:2017 [11], mas integra-se perfeitamente ao conceito baseado em erros e exceções da plataforma: para o parâmetro de template E, é obrigatoriamente predefinido o tipo de erro ara::core::ErrorCode; qualquer especificação divergente resulta em erro de compilação. Os parceiros primários de interação incluem o produtor assíncrono (como uma Promise associada), que fornece o valor ou erro, a instância de Future como receptora exclusiva, bem como um consumidor ou contexto de execução (ExecutorT) para o qual tarefas subsequentes são passadas [SWS_CORE_00331] [SWS_CORE_00337].

Ciclo de vida

A criação, o gerenciamento de estado e a destruição de ara::core::Future estão sujeitos a regras estritas para garantir relações de posse determinísticas:

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 define valor ou erro ValidReady->Invalid GetResult() / get() / then()

Diagrama de estados: ciclo de vida e transições de estado de uma instância de Future em relação à validade e disponibilidade do Shared State. Fontes: [SWS_CORE_00322], [SWS_CORE_00326], [SWS_CORE_00327], [SWS_CORE_00331], [SWS_CORE_00332], [SWS_CORE_00333], [SWS_CORE_00336]

Caminho de utilização

Um caminho de uso típico para o processamento de resultados divide-se nas seguintes fases:

  1. Verificação de status e sincronização: Com is_ready(), é possível determinar com antecedência se o resultado assíncrono já está disponível [SWS_CORE_00332]. Caso esteja, chamadas subsequentes têm a garantia de não mais bloquear [SWS_CORE_00332]. Caso contrário, é possível sincronizar sem limite de tempo com wait() [SWS_CORE_00328] ou com limite de tempo via wait_for() ou wait_until() [SWS_CORE_00329] [SWS_CORE_00330].
  2. Extração do resultado: Em aplicações AUTOSAR Adaptive, a chamada de GetResult() é determinante: o método bloqueia quando necessário, mas nunca dispara exceções e transfere o valor ou erro como ara::core::Result<T, E> por movimentação [SWS_CORE_00336]. O método get() oferece conformidade com a STL, lança exceções C++ em caso de erro e não participa da resolução de sobrecarga se o tratamento de exceções da toolchain estiver desativado [SWS_CORE_00326].
  3. Encadeamento assíncrono (continuations): Em vez de bloqueio síncrono, um callback pode ser registrado via then(), opcionalmente com atribuição a um contexto de execução (executor) [SWS_CORE_00331] [SWS_CORE_00337]. O callback recebe o resultado como um rvalue de Result<T, E>. Se a própria função de continuação retornar um Future ou Result, then() realiza um desenvelopamento automático e fornece diretamente um Future<T2, E2> correspondente [SWS_CORE_00331] [SWS_CORE_00337].
Fluxo assíncrono com GetResult()ChamadorFuturePromiseErzeugt Shared State & FutureUebergabe an KonsumentUse Case: Sincronização e obtençãois_ready()falseSetResult(...) / SetError(...)GetResult()Shared State geleertvalid() == falseResult<T, E>

Diagrama de sequência: fluxo típico de sincronização assíncrona e obtenção de resultado via GetResult(). Fontes: [SWS_CORE_00327], [SWS_CORE_00332], [SWS_CORE_00336]

Cenários de erro

Ao lidar com ara::core::Future, estão especificadas as seguintes situações de erro:

  • Chamada em instância inválida: A chamada de is_ready(), wait(), wait_for(), wait_until(), GetResult() ou then() em uma instância inválida (valid() == false) constitui uma FutureInvalidViolation [SWS_CORE_00328] [SWS_CORE_00329] [SWS_CORE_00330] [SWS_CORE_00331] [SWS_CORE_00332] [SWS_CORE_00336] [SWS_CORE_00337]. Ao chamar get(), uma FutureException com o código de erro kNoState é lançada nesse caso [SWS_CORE_00326].
  • Shared State abandonado (Broken Promise): Se o Shared State for abandonado prematuramente pela Promise associada, GetResult() fornece um Result com o código de erro padronizado FutureErrc::kBrokenPromise [SWS_CORE_00336]. Ao chamar get(), a exceção correspondente é disparada [SWS_CORE_00326].
  • Exceções em funções de continuação: Uma continuação registrada não deve lançar exceções, exceto para a implementação de uma Violation. Se ainda assim ela disparar uma exceção, isso resultará em uma FutureContinuationHasThrownViolation [SWS_CORE_00331] [SWS_CORE_00337]. Exceções em closures devem ser capturadas e retornadas como estado de erro na forma de um Result ou Future [SWS_CORE_00331] [SWS_CORE_00337].

Este guia baseia-se exclusivamente nos requisitos de especificação do AUTOSAR Adaptive Core (R25-11).

Mapa de membros

Diagrama de classes

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()

Vista de detalhes

Selecione uma entrada no índice.

Construtores e destrutor

Future função 3

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

Sobrecargas Future 3
Future () noexcept=default; SWS_CORE_00322
Future (Future &&other) noexcept; SWS_CORE_00323
Future (const Future &)=delete; SWS_CORE_00334
~Future função

Destructor for Future objects. Abandons any shared state

~Future () noexcept;

Métodos

get função

Get the value.

T get () noexcept(false);
GetResult função

Get the result.

Result< T, E > GetResult () noexcept(std::is_nothrow_move_ constructible< T >::value &&std::is_nothrow_move_constructible< E >::value);
is_ready função

Return whether the asynchronous operation has finished.

bool is_ready () const noexcept;
then função 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.

Sobrecargas 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 função

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

bool valid () const noexcept;
wait função

Wait for a value or an error to be available.

void wait () const noexcept;
wait_for função

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 função

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;

Operadores

operator= função 2

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

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

Documentação dos métodos

função 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#58dbc5ef
Content hash
58dbc5ef
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

função 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#8897e321
Content hash
8897e321
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

função 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#f962240c
Content hash
f962240c
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

função 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#87a2d9ed
Content hash
87a2d9ed
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

função 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 ).

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: bdf8e21a85ce Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método get() obtém de forma síncrona o resultado do tipo T a partir de um ara::core::Future [SWS_CORE_00326]. A função comporta-se de forma idêntica à contraparte em std::future; caso o cálculo assíncrono ainda esteja a decorrer, a chamada bloqueia até à conclusão ou até à ocorrência de um erro [SWS_CORE_00336]. Através da chamada, o objeto perde o seu estado, de modo que o future fica imediatamente inválido (valid() == false) [SWS_CORE_00326]. Uma chamada sem bloqueio pode ser previamente assegurada através de is_ready() [SWS_CORE_00332].

Tratamento de erros

As falhas são comunicadas através de exceções C++ [SWS_CORE_00326]:

  • Se tiver sido registado um erro no Promise associado através de SetError() ou SetResult(), é lançada uma exceção do tipo de erro correspondente [SWS_CORE_00326].
  • Se o estado partilhado (shared state) for abandonado prematuramente pela operação assíncrona, tal resulta no erro kBrokenPromise em conformidade com FutureErrc [SWS_CORE_00326], [SWS_CORE_00400].
  • Se a chamada ocorrer numa instância inválida, é lançada uma FutureException com o código de erro kNoState [SWS_CORE_00326].

Simultaneidade e restrições

A operação não é segura para threads nem segura quanto a exceções (not exception safe) [SWS_CORE_00326]. Acessos simultâneos ao mesmo future a partir de múltiplas threads requerem sincronização externa. Se as exceções estiverem desativadas na toolchain do compilador, get() não participa na resolução de sobrecargas [SWS_CORE_00326]; para este caso, existe a alternativa isenta de exceções GetResult() [SWS_CORE_00336]. Para instâncias sem valor de retorno, está disponível a especialização Future<void, E>::get() [SWS_CORE_06226].

Esta nota de uso foi criada de forma automatizada com base na especificação 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#9975df4f
Content hash
9975df4f
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

função 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#27f42d6e
Content hash
27f42d6e
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

função 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#4d9fc0af
Content hash
4d9fc0af
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

função 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#4cafb477
Content hash
4cafb477
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 771d2952e4cb Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

A função-membro then destina-se ao encadeamento de cálculos assíncronos e regista um objeto invocável func como continuação (continuation) numa instância de ara::core::Future [SWS_CORE_00331]. Após o retorno da chamada, a Future original fica inválida (valid() == false). O destino da chamada recebe o resultado da instância obtido através de GetResult() transmitido como rvalue do tipo Result<T, E> [SWS_CORE_00331].

O tipo de retorno de then rege-se pelo tipo de retorno U da continuação [SWS_CORE_00331]:

  • Se func devolver um Future<T2, E2>, ocorre o desempacotamento implícito de future (future unwrapping) para Future<T2, E2> [SWS_CORE_00331].
  • Se func devolver um Result<T2, E2>, ocorre o desempacotamento implícito de result (result unwrapping) para Future<T2, E2> [SWS_CORE_00331].
  • Em todos os restantes casos, o tipo de retorno é Future<U, E> [SWS_CORE_00331].

A execução de func pode ter lugar de forma síncrona no contexto da chamada de then, no contexto de Promise::set_result ou Promise::SetError, ou noutro contexto [SWS_CORE_00331]. A chamada está especificada como não sendo segura para threads. A continuação é registada no Future devolvido; após o retorno do seu destruidor, nenhuma continuação poderá ser executada, enquanto uma execução já em curso continuará até ao fim [SWS_CORE_00331].

Não existem códigos de erro normalizados [SWS_CORE_00331]. Os erros devem ser intercetados pelos utilizadores e reencaminhados como código de erro num Result devolvido ou numa Future, dado que as exceções não podem sair da continuação. Uma chamada numa Future inválida desencadeia FutureInvalidViolation; se a continuação lançar uma exceção, tal resulta em FutureContinuationHasThrownViolation [SWS_CORE_00331].

Para execuções num contexto de execução explícito, está disponível a sobrecarga com executor [SWS_CORE_00337], enquanto para operações sem valor de retorno se aplica a especialização void [SWS_CORE_06231].

Esta nota de uso foi gerada por uma IA com base na especificação 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#3f6512d0
Content hash
3f6512d0
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: b5ca6c97ece5 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Utilização e semântica

O método then regista uma continuação (func) que é executada assincronamente no contexto do executor passado assim que o resultado da instância atual de Future estiver disponível [SWS_CORE_00337]. A unidade invocável recebe o resultado da instância como uma expressão rvalue do tipo Result<T,E> [SWS_CORE_00337]. O tipo de retorno rege-se pelo tipo de retorno U da continuação:

  • Se a continuação devolver um Future<T2,E2>, ocorre um desempacotamento implícito para Future<T2,E2> [SWS_CORE_00337].
  • Se a continuação devolver um Result<T2,E2>, este também é resolvido implicitamente para Future<T2,E2> [SWS_CORE_00337].
  • Em todos os outros casos, a chamada fornece Future<U,E> [SWS_CORE_00337].

Concorrência e ciclo de vida

Imediatamente após o retorno da chamada do método, a instância original de Future fica inválida (valid() == false) [SWS_CORE_00337]. A função está declarada como não segura para threads [SWS_CORE_00337]. As continuações registadas são geridas no Future recentemente devolvido. Após o término do seu destrutor, já nenhuma continuação pode ser iniciada; uma execução já em curso é concluída, pelo que o destrutor pode bloquear [SWS_CORE_00337].

Tratamento de erros e interação

Não estão definidos códigos de erro normalizados [SWS_CORE_00337]. Uma chamada numa instância inválida desencadeia a violação FutureInvalidViolation [SWS_CORE_00337]. Se a continuação lançar uma exceção, tal resulta numa FutureContinuationHasThrownViolation; as exceções devem, portanto, ser capturadas e reencaminhadas como erros através de ara::core::Result ou ara::core::Future [SWS_CORE_00337]. Em comparação com a sobrecarga sem contexto de execução [SWS_CORE_00331], esta variante força a execução no executor passado; para tipos de resultados void, existe a especialização análoga [SWS_CORE_06237].

Esta nota de utilização baseia-se na especificação 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#50801a18
Content hash
50801a18
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 0fe78ab97a32 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

A função de consulta síncrona valid() verifica, sem parâmetros, se uma instância de ara::core::Future possui um estado partilhado (Shared State) e se, por conseguinte, está utilizável [SWS_CORE_00327]. Retorna true caso o objeto esteja pronto para utilização e false se não existir nenhum estado partilhado [SWS_CORE_00327]. O comportamento corresponde à função standard std::future::valid e aplica-se da mesma forma à especialização de template ara::core::Future<void, E> [SWS_CORE_06227].

A função é declarada como noexcept, é considerada segura face a exceções (exception safe) e está expressamente especificada como segura para threads (thread-safe) [SWS_CORE_00327]. Não desencadeia por si própria quaisquer códigos de erro ou exceções e pode, portanto, ser utilizada em segurança para a verificação de estado [SWS_CORE_00327].

Na interação com outros métodos de Future, a verificação de validade é crucial, uma vez que operações chamadoras como wait() [SWS_CORE_00328] ou is_ready() [SWS_CORE_00332] desencadeiam uma FutureInvalidViolation em caso de estado inválido (valid() == false). Uma Future anteriormente válida torna-se automaticamente inválida assim que o seu resultado for consumido através de get() [SWS_CORE_00326] ou GetResult() [SWS_CORE_00336], ou assim que for registado um processamento posterior através de then() [SWS_CORE_00331], [SWS_CORE_00337].

Este texto foi criado por uma IA e serve como orientação. Apenas as especificações AUTOSAR referenciadas são vinculativas.

Guia do implementador em breve (complexidade 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#9789bdb1
Content hash
9789bdb1
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

função 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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 9635b0074677 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

A função-membro wait da classe ara::core::Future bloqueia a thread chamadora de forma síncrona até que um valor de resultado ou um erro da operação assíncrona esteja disponível [SWS_CORE_00328]. A função não aceita parâmetros, não retorna nenhum valor e se comporta, de acordo com a especificação, de forma análoga à função correspondente de std::future [SWS_CORE_00328]. O mesmo comportamento se aplica à especialização de template ara::core::Future<void, E> [SWS_CORE_06228].

Em relação ao tratamento de erros e à concorrência, estão definidos os seguintes requisitos:

  • Condição de erro: Se o objeto Future for inválido (valid == FALSE), ocorre uma FutureInvalidViolation [SWS_CORE_00328], [SWS_CORE_06228]. Ainda assim, a função é declarada como noexcept e classificada como segura para exceções (exception safe) [SWS_CORE_00328].
  • Segurança de thread: A chamada é classificada explicitamente como not thread-safe [SWS_CORE_00328]. O acesso concorrente ao mesmo objeto Future sem sincronização externa é inadmissível.

Na interação com interfaces relacionadas, recomenda-se a verificação por meio de is_ready antes da chamada [SWS_CORE_00332], [SWS_CORE_06232]: se esta retornar true, a chamada de wait garantidamente não mais bloqueará. Caso seja necessária uma operação de bloqueio limitada no tempo em vez de uma espera indefinida, estão disponíveis alternativamente wait_for com uma duração relativa [SWS_CORE_00329], [SWS_CORE_06229] e wait_until com um instante absoluto [SWS_CORE_00330], [SWS_CORE_06230].

Esta nota de uso foi gerada automaticamente com base na especificação 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#771854ee
Content hash
771854ee
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 360b2640b7ed Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

A função-membro wait_for da classe ara::core::Future bloqueia a thread chamadora por no máximo o intervalo de tempo fornecido timeoutDuration ou até que um valor de resultado ou um erro esteja disponível no estado compartilhado [SWS_CORE_00329]. Seu comportamento corresponde ao da função correspondente de std::future [SWS_CORE_00329]. Como valor de retorno, fornece um FutureStatus [SWS_CORE_00329], que indica se o estado compartilhado está disponível (kReady) ou se o tempo de espera especificado expirou (kTimeout) [SWS_CORE_00361].

Tratamento de erros e condições de contorno

A função é declarada como noexcept e especificada como segura contra exceções (exception safe) [SWS_CORE_00329]. Se o objeto Future for inválido (valid == FALSE), ocorre uma violação na forma de FutureInvalidViolation [SWS_CORE_00329]. Interpretação: Como nenhuma exceção C++ pode ser lançada, tal violação provavelmente deve ser tratada do lado da plataforma como um erro fatal de tempo de execução. Pergunta Q-2f22a07f6e143856 (aberta)

Concorrência e interação

A operação é classificada como not thread-safe [SWS_CORE_00329]; acessos simultâneos à mesma instância requerem, portanto, sincronização externa. A semântica e a assinatura aplicam-se de forma idêntica à especialização de template ara::core::Future<void, E> [SWS_CORE_06229]. Ao contrário de std::future_status, não existe entrada para deferred no tipo de enumeração FutureStatus [SWS_CORE_00361].

Este texto foi gerado por uma IA com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade 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#29931e7c
Content hash
29931e7c
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: b4703e774b3e Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

A função-membro wait_until bloqueia a thread chamadora até que o instante absoluto especificado deadline seja alcançado ou até que o ara::core::Future disponibilize um resultado ou erro [SWS_CORE_00330]. O comportamento orienta-se pela função correspondente de std::future [SWS_CORE_00330].

Como valor de retorno, a função fornece um FutureStatus [SWS_CORE_00330]. Este tipo de enum sinaliza, por meio do estado kReady, que o estado compartilhado está pronto (valor ou erro disponível) ou, por meio de kTimeout, que o prazo expirou sem resultado [SWS_CORE_00361]. Um estado análogo a std::future_status::deferred não existe em FutureStatus [SWS_CORE_00361].

No que diz respeito ao tratamento de erros e à segurança de exceções, a função é especificada como segura contra exceções (exception safe) e noexcept [SWS_CORE_00330]. No entanto, se a função for chamada em uma instância inválida (valid == FALSE), ocorre uma violação sob a forma de FutureInvalidViolation [SWS_CORE_00330].

Em relação à concorrência, wait_until é classificada como não segura para threads (not thread-safe) [SWS_CORE_00330]. Acessos paralelos ao mesmo objeto ara::core::Future devem, portanto, ser sincronizados externamente. A mesma semântica e assinatura aplicam-se à especialização ara::core::Future<void, E> [SWS_CORE_06230].

Este texto foi criado por uma IA e serve como orientação. O documento determinante é a especificação.

Guia do implementador em breve (complexidade 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#01a6e950
Content hash
01a6e950
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

função ~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#0ce9d9db
Content hash
0ce9d9db
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