fonction Create [SWS_EM_02562] Upstream: RS_AP_00119, RS_AP_00120, RS_AP_00128, RS_AP_00139, RS_AP_00144, RS_EM_00103, RS_AP_00159
static ara::core::Result< ExecutionClient > Create (std::function< void()> terminationHandler) noexcept;
Named constructor for ExecutionClient.
La fonction statique Create sert de Named Constructor pour instancier ara::exec::ExecutionClient [SWS_EM_02562]. Lors de l’appel, le callback terminationHandler (de type std::function<void()>) est transmis, lequel est exécuté de manière concurrente dans un thread d’arrière-plan lors de l’arrivée d’un signal SIGTERM [SWS_EM_02562]. En règle générale, ce callback positionne un drapeau global ou réveille des threads bloqués afin d’initier une terminaison ordonnée (graceful termination). L’appelant doit garantir que le gestionnaire reste appelable pendant toute la durée de vie de l’instance de ExecutionClient, ce qui doit particulièrement être pris en compte lors de liaisons à des instances d’objet via std::bind [SWS_EM_02562].
Comme valeur de retour, la fonction fournit un ara::core::Result<ExecutionClient> qui contient soit l’instance créée, soit un code d’erreur [SWS_EM_02562]. Si la création échoue, deux erreurs spécifiques sont définies :
ara::exec::ExecErrc::kInvalidArgument: leterminationHandlertransmis ne contient aucune fonction appelable (sémantique de rollback ; résolution en transmettant un callable valide) [SWS_EM_02562].ara::exec::ExecErrc::kNoCommunication: une erreur de communication est survenue (pas de sémantique de rollback ; résolution en effectuant une nouvelle tentative) [SWS_EM_02562].
La fonction est déclarée comme noexcept, est considérée comme Exception-safe ainsi que Thread-safe et peut appeler en interne un constructeur défini par le développeur [SWS_EM_02562]. Interprétation : l’appel devrait généralement avoir lieu pendant la phase d’initialisation précoce d’un processus, afin de configurer la gestion des signaux à temps avant le début de la charge de travail principale. Question Q-555aea895feb2123 (ouverte) Ce modèle de Named Constructor avec enregistrement de callback correspond à la création du StateClient via sa propre fonction Create [SWS_EM_02276].
Ce texte a été généré par un système d’IA sur la base de données de spécification.
| Header-Datei | #include "ara/exec/execution_client.h" |
|---|---|
| Scope | class ara::exec::ExecutionClient |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| terminationHandler | Callback which is called if ExecutionClient receives SIGTERM signal. The callback is executed in a background thread. A typical implementation of this callback will set a global flag (and potentially unblock other threads) to perform a graceful termination. Lifetime: it is expected that terminationHandler remains callable, during entire lifetime of the ExecutionClient instance. This is especially important if, terminationHandler is bound to an instance of a class (e.g. using std::bind). |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<ExecutionClient > | a result that contains either a ExecutionClient object or an error. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| ara::exec::ExecErrc::kNoCommunication | no_rollback_semantics Communication error occurred. Recovery: try again |
| ara::exec::ExecErrc::kInvalidArgument | rollback_semantics Given terminationHandler doesn’t contain a callable function. Recovery: change argument |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_EM_02562- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_EM_02562@rel:R25-11#e6d25e2a- Content hash
e6d25e2a- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_ExecutionManagement.pdf#nameddest=SWS_EM_02562
Status: valid/unmigrated
Version: rel:R25-11#446bd257
Versionshistorie & Revisions (1 transition, 4 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_EM_02562@rel:R25-11#446bd257
Recorded Revisions (4):
- R25-11
rel:R25-11#b09af1042026-09-30 - R23-11
rel:R23-11#10b43bed2026-10-14 - R24-11
rel:R24-11#7ed2aeda2026-10-14 - R25-11
rel:R25-11#446bd2572026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · Original allemand