DEENESPTFRRUARHIKOZHNL

class ara::core::Executor

[SWS_CORE_00008] Upstream: RS_AP_00130

class Executor {...};

Provides an interface for a executing context, which asynchronously invokes Callable ([4] [func.wrap.func]) objects in a guaranteed thread-safe context. The execute(...) method in [SWS_CORE_00024] returns a ara::core::Future object to the caller for further result/error extraction or management of the asynchronous-context; the execute_oneway(...) method in [SWS_CORE_00025] imply fire-and-forget semantics and thus no asynchronous-context (ara::core::Future) is returned.

Literaturverzeichnis SWS Core: [4] ISO/IEC 14882:2014, Information technology – Programming languages – C++ – www.iso.org

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

User GuideAI-GENERATED

Enables the asynchronous, thread-safe execution of callables with optional return values via futures.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 690890643de1 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables the asynchronous, thread-safe execution of callables with optional return values via futures.

Class ara::core::Executor provides an interface for asynchronous execution of callables in a guaranteed thread-safe context. Tasks are either initiated in a result-oriented manner via execute [SWS_CORE_00024] returning a ara::core::Future for values or error codes, or dispatched status-independently via oneway_execute [SWS_CORE_00025] in fire-and-forget mode. As a central constraint, it must be noted that execute itself is not thread-safe and parallel calls on the same instance must be synchronized externally, whereas execution of the callable in the background is performed thread-safely.

Context

Class ara::core::Executor provides an interface for an execution context that asynchronously executes callables in a guaranteed thread-safe environment. It serves as an abstraction layer between the calling thread and asynchronous background processing. Two mechanisms are available for submitting tasks: Method execute [SWS_CORE_00024] passes a task in a result-oriented manner and returns a ara::core::Future object, through which the subsequent return value or an error code can be synchronized and queried. For pure notifications or status-independent background operations, the class provides method oneway_execute [SWS_CORE_00025], which follows fire-and-forget semantics and does not return an asynchronous context to the caller. Presumably, the concrete implementation encapsulates a thread management or task queue in the background to coordinate concurrent processing. Question Q-068fe33f2900d6cf (open)

Lifecycle

The instantiation and lifetime of an ara::core::Executor are subject to differentiated rules regarding exception safety and thread safety:

  • Copying: The copy constructor [SWS_CORE_00009] and the copy assignment operator [SWS_CORE_00017] are specified as thread-safe, but are classified as not exception safe. A copy operation may therefore fail if required resources cannot be allocated.
  • Moving: The move constructor [SWS_CORE_00015] and the move assignment [SWS_CORE_00018] are declared as noexcept and are thus exception-safe. However, move operations are not thread-safe (not thread-safe); hence, concurrent accesses during moving must be synchronized by the caller.
  • Destruction: Destructor [SWS_CORE_00019] is noexcept and implemented as thread-safe, allowing the lifecycle of an instance to be terminated safely.

Regarding concurrency during operation, a fundamental division becomes apparent: While oneway_execute [SWS_CORE_00025] is thread-safe, execute [SWS_CORE_00024] is classified as not thread-safe. The lack of thread safety in execute is likely attributable to the internal creation and management of the underlying state object for the resulting future, which is why concurrent invocations of execute on the same instance must be synchronized externally. Question Q-4425e6b07758230e (open)

Usage Path

Usage of ara::core::Executor is divided into two primary paths, depending on whether a return value is required:

  1. Result-oriented path (execute): The caller passes a callable object f as well as optional arguments p... to execute [SWS_CORE_00024]. The method immediately returns a ara::core::Future whose result type is based on the deduced return type of the call. The callable is executed asynchronously in the guaranteed context. Once processing is complete, the caller can extract the result value or a potential error code from the future.
  2. One-way path (oneway_execute): If the caller requires neither feedback nor synchronization, oneway_execute [SWS_CORE_00025] is invoked. The callable is likewise executed asynchronously, but no return value exists (void).
Asynchronous execution sequence with ara::core::ExecutorCallerara::core::ExecutorAsynchroner Kontextara::core::Futureexecute(f, p...)Future erzeugenReturn ara::core::Futuref(p...) asynchron startenExecute Callable f(p...)Set result or errorErgebnis / Fehler abfragenErgebniswert / Fehlercode

Sequence diagram: Asynchronous task processing via execute and result retrieval via future. Sources: [SWS_CORE_00024]

Error Scenarios

The invocation methods execute [SWS_CORE_00024] and oneway_execute [SWS_CORE_00025] do not throw C++ exceptions; both are explicitly specified as noexcept. Likewise, the specification for execute defines no standardized error codes for the dispatch invocation itself [SWS_CORE_00024].

If, however, an error occurs during the asynchronous execution of the callable, it is propagated via the ara::core::Future returned by execute: In the event of an error, the future encapsulates an error code, whereas in case of success, type ara::core::Result::value_type is provided with the function result [SWS_CORE_00024]. For oneway_execute [SWS_CORE_00025], by design there is no possibility of returning an error to the caller; errors remain within the asynchronous context.

This guide was curated by an AI and relies exclusively on the specification of AUTOSAR Adaptive R25-11.

Member map

Constructors and destructor

2

Operators

1

Class diagram

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

G nara__core__Executor877 Executor + Executor() + operator=() + ~Executor() + execute() + oneway_execute()

Detail view

Select an entry in the outline.

Constructors and destructor

Executor function 2

Copy constructor

Overloads Executor 2
Executor (const Executor &other); SWS_CORE_00009
Executor (Executor &&other) noexcept; SWS_CORE_00015
~Executor function

Destructor

~Executor () noexcept;

Methods

execute function

Asynchronously invoke F with the provided arguments P....

template <class F, class... P> ara::core::Future< std::invoke_result_t< std::decay_t< F >, std::decay_t< P >... > > execute (F &&f, P &&... p) noexcept;

Asynchronously invoke F with the provided arguments P....

template <class F, class... P> void oneway_execute (F &&f, P &&... p) noexcept;

Operators

operator= function 2

Copy assignment operator

Overloads = 2
Executor & operator= (const Executor &other); SWS_CORE_00017
Executor & operator= (Executor &&other) noexcept; SWS_CORE_00018

Method documentation

function Executor [SWS_CORE_00009] Upstream: RS_AP_00130

Executor (const Executor &other);

Copy constructor

Header-Datei#include "ara/core/executor.h"
Scopeclass ara::core::Executor
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
otherOther ara::core::Executor to copy

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

Record
AUTOSAR/AP/record/SWS_CORE_00009
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00009@rel:R25-11#3391383e
Content hash
3391383e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00009
Status: valid/unmigrated Version: rel:R25-11#60a2a566 Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00009@rel:R25-11#60a2a566
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#3391383e2026-09-30
  • R24-11rel:R24-11#6c85f96c2026-10-14
  • R25-11rel:R25-11#60a2a5662026-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

function Executor [SWS_CORE_00015] Upstream: RS_AP_00130

Executor (Executor &&other) noexcept;

Move constructor

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

Parameter (in)

ParameterBeschreibung
otherOther ara::core::Executor to move

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

Record
AUTOSAR/AP/record/SWS_CORE_00015
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00015@rel:R25-11#5a1547e7
Content hash
5a1547e7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00015
Status: valid/unmigrated Version: rel:R25-11#aa1a25ba Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00015@rel:R25-11#aa1a25ba
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#5a1547e72026-09-30
  • R24-11rel:R24-11#0606a2422026-10-14
  • R25-11rel:R25-11#aa1a25ba2026-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

function execute [SWS_CORE_00024] Upstream: RS_AP_00130

template <class F, class... P> ara::core::Future< std::invoke_result_t< std::decay_t< F >, std::decay_t< P >... > > execute (F &&f, P &&... p) noexcept;

Asynchronously invoke F with the provided arguments P....

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9d31d266cefd Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function execute of class ara::core::Executor serves for the asynchronous execution of a passed function object f together with the arguments p... ([SWS_CORE_00024]). As a return value, it provides a ara::core::Future, which in case of success encapsulates the result of the call or in case of error provides a corresponding error code ([SWS_CORE_00024]). The function itself is declared with the specifier noexcept.

Standardized error codes are not specified for the function call ([SWS_CORE_00024]). Regarding concurrency, although execute is classified as exception safe, it is explicitly considered not thread-safe ([SWS_CORE_00024]). Concurrent accesses to the same instance of ara::core::Executor are therefore likely to require synchronization at the user level. Question Q-6b839826a7d9742f (open)

The interplay with asynchronous control flows is evident in particular with chaining via then ([SWS_CORE_00337], [SWS_CORE_06237]). There, an executor context is passed, in whose context subsequent continuation functions are executed with the received ara::core::Result.

This text was automatically generated. All technical details are based on the specification AUTOSAR Adaptive R25-11.

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

Template-Parameter

ParameterBeschreibung
Fa Callable type
Pargument list to the Callable

Parameter (in)

ParameterBeschreibung
fa Callable to be executed
pparameters to be supplied with the Callable

Rückgabewert

TypBeschreibung
ara::core::Future<std::invoke_result_t<std::decay_t< F >, std::decay_t< P >... > >• If successful: an ara::core::Future containing a ara:: core::Result::value_type containing the result of the callable F • If unsuccessful: an ara::core::Future containing an Error Code

Fehler

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_00024
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00024@rel:R25-11#8144c3b1
Content hash
8144c3b1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00024
Status: valid/unmigrated Version: rel:R25-11#6c85a6a9 Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00024@rel:R25-11#6c85a6a9
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#8144c3b12026-09-30
  • R24-11rel:R24-11#d465a8212026-10-14
  • R25-11rel:R25-11#6c85a6a92026-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

function oneway_execute [SWS_CORE_00025] Upstream: RS_AP_00130

template <class F, class... P> void oneway_execute (F &&f, P &&...                p) noexcept;

Asynchronously invoke F with the provided arguments P....

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 1e96ad32e48d Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Semantics

The template function oneway_execute of class ara::core::Executor is used for the asynchronous execution of a callable unit f (callable) with the passed arguments p... [SWS_CORE_00025]. Since the function does not yield a return value (return type void) and execution takes place asynchronously, the call returns immediately to the caller without waiting for the completion or a result of the execution [SWS_CORE_00025].

Error Handling and Exception Safety

The function is declared as noexcept and specified as exception-safe (exception safe) [SWS_CORE_00025]. Potential errors or exceptions within the passed callable must therefore presumably be caught and handled internally within the callable itself, as no error feedback or exception can be propagated to the calling context. Question Q-c8d31cfa9c2e3ab9 (open)

Concurrency and Limitations

According to the specification, oneway_execute is classified as thread-safe (thread-safe) [SWS_CORE_00025]. The function can thus be called concurrently from different threads on the same instance of ara::core::Executor. Inclusion is done via header file #include "ara/core/executor.h" [SWS_CORE_00025].

This usage note was generated automatically based on AUTOSAR R25-11.

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

Template-Parameter

ParameterBeschreibung
Fa Callable type
Pargument list to the Callable

Parameter (in)

ParameterBeschreibung
fa Callable to be executed
pparameters to be supplied with the Callable

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CORE_00025
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00025@rel:R25-11#ebd0128b
Content hash
ebd0128b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00025
Status: valid/unmigrated Version: rel:R25-11#f89da2ea Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00025@rel:R25-11#f89da2ea
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#ebd0128b2026-09-30
  • R24-11rel:R24-11#fe75fa6e2026-10-14
  • R25-11rel:R25-11#f89da2ea2026-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

function operator= [SWS_CORE_00017] Upstream: RS_AP_00130

Executor & operator= (const Executor &other);

Copy assignment operator

Header-Datei#include "ara/core/executor.h"
Scopeclass ara::core::Executor
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
otherOther ara::core::Executor to copy

Rückgabewert

TypBeschreibung
Executor &The copied object

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

Record
AUTOSAR/AP/record/SWS_CORE_00017
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00017@rel:R25-11#c0dcae29
Content hash
c0dcae29
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00017
Status: valid/unmigrated Version: rel:R25-11#6011a69d Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00017@rel:R25-11#6011a69d
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#c0dcae292026-09-30
  • R24-11rel:R24-11#137015232026-10-14
  • R25-11rel:R25-11#6011a69d2026-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

function operator= [SWS_CORE_00018] Upstream: RS_AP_00130

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

Move assignment operator

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

Parameter (in)

ParameterBeschreibung
otherOther ara::core::Executor to move

Rückgabewert

TypBeschreibung
Executor &The moved object

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

Record
AUTOSAR/AP/record/SWS_CORE_00018
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00018@rel:R25-11#57cffdd3
Content hash
57cffdd3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00018
Status: valid/unmigrated Version: rel:R25-11#1ca71ff7 Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00018@rel:R25-11#1ca71ff7
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#57cffdd32026-09-30
  • R24-11rel:R24-11#15bce54f2026-10-14
  • R25-11rel:R25-11#1ca71ff72026-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

function ~Executor [SWS_CORE_00019] Upstream: RS_AP_00130

~Executor () noexcept;

Destructor

Header-Datei#include "ara/core/executor.h"
Scopeclass ara::core::Executor
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_00019
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_00019@rel:R25-11#96c96d48
Content hash
96c96d48
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_00019
Status: valid/unmigrated Version: rel:R25-11#336c443d Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_00019@rel:R25-11#336c443d
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#96c96d482026-09-30
  • R24-11rel:R24-11#7a18cb1c2026-10-14
  • R25-11rel:R25-11#336c443d2026-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