fonction Create [SWS_EM_02276] Upstream: RS_EM_00101, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00139, RS_AP_00144, RS_AP_00159
static ara::core::Result< StateClient > Create (std::function< void(const ara::exec::ExecutionErrorEvent &)> undefinedStateCallback) noexcept;
Named constructor for StateClient.
La méthode fabrique statique Create sert de constructeur nommé (Named Constructor) pour créer une instance de ara::exec::StateClient ([SWS_EM_02276]). undefinedStateCallback est transmis en tant que paramètre obligatoire. Ce rappel est déclenché par la bibliothèque cliente lorsqu'un groupe de fonctions passe de manière inattendue – c'est-à-dire sans demande préalable via SetState() – dans un état indéfini ([SWS_EM_02276]). À cette occasion, le groupe de fonctions concerné et l'erreur sont transmis au rappel via un ExecutionErrorEvent.
Des conditions-cadres strictes s'appliquent au contexte d'appel et à la durée de vie :
- La fonction est thread-safe, exception-safe et déclarée comme
noexcept([SWS_EM_02276]). - Le
undefinedStateCallbacktransmis doit rester invocable pendant toute la durée de vie de l'instance deStateClientcréée ([SWS_EM_02276]). Cela requiert un soin particulier lors de liaisons à des instances d'objets (par exemple au moyen destd::bind).
L'instanciation s'effectue de manière synchrone et renvoie un ara::core::Result<StateClient> ([SWS_EM_02276]). En cas d'erreur, les codes d'erreur suivants sont définis :
ara::exec::ExecErrc::kInvalidArgument: est signalé lorsque l'argument transmis ne contient aucune fonction invocable (sémantique de rollback ; résolution par la fourniture d'une fonction valide) ([SWS_EM_02276]).ara::exec::ExecErrc::kNoCommunication: signale une erreur de communication (sémantique sans rollback ; résolution par une nouvelle tentative) ([SWS_EM_02276]). Cela devrait vraisemblablement être dû à un échec de l'établissement de la connexion vers l'environnement d'exécution. Question Q-c312c2b5e7c3c7d0 (ouverte)
Le patron de construction correspond structurellement à l'approche d'initialisation de clients d'exécution apparentés tels que ara::exec::ExecutionClient ([SWS_EM_02562]), qui est également créé avec un rappel obligatoire via un constructeur nommé.
Cette note d'utilisation a été générée automatiquement sur la base des données de spécification d'AUTOSAR R25-11.
Guide de l'implémenteur à venir (complexité I1)
| Header-Datei | #include "ara/exec/state_client.h" |
|---|---|
| Scope | class ara::exec::StateClient |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| undefinedStateCallback | callback to be invoked by StateClient library if a FunctionGroup changes its state unexpectedly to an Undefined Function Group State, i.e. without previous request by SetState(). The affected FunctionGroup and ExecutionError is provided as an argument to the callback in form of ExecutionErrorEvent. Lifetime: it is expected that undefinedStateCallback remains callable, during entire lifetime of the StateClient instance. This is especially important if, undefinedStateCallback is bound to an instance of a class (e.g. using std::bind). |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result< StateClient > | a result that contains either a StateClient 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 undefinedStateCallback 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_02276- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_EM_02276@rel:R25-11#25c221b8- Content hash
25c221b8- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_ExecutionManagement.pdf#nameddest=SWS_EM_02276
Status: valid/unmigrated
Version: rel:R25-11#e0c84a0f
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_EM_02276@rel:R25-11#e0c84a0f
Recorded Revisions (8):
- R25-11
rel:R25-11#4f8bba6e2026-09-30 - R19-11
rel:R19-11#de12c8242026-10-14 - R20-11
rel:R20-11#e48137012026-10-14 - R21-11
rel:R21-11#656a7fe92026-10-14 - R22-11
rel:R22-11#76c30edc2026-10-14 - R23-11
rel:R23-11#7c0d72972026-10-14 - R24-11
rel:R24-11#924d8c912026-10-14 - R25-11
rel:R25-11#e0c84a0f2026-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