functie 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.
De statische factory-methode Create dient als named constructor voor het aanmaken van een instantie van ara::exec::StateClient ([SWS_EM_02276]). Als verplichte parameter wordt undefinedStateCallback doorgegeven. Deze callback wordt door de client-bibliotheek geactiveerd wanneer een functiegroep onverwacht – dat wil zeggen zonder voorafgaand verzoek via SetState() – naar een ongedefinieerde toestand overgaat ([SWS_EM_02276]). Daarbij worden de getroffen functiegroep en de fout via een ExecutionErrorEvent aan de callback doorgegeven.
Voor aanroepcontext en levensduur gelden vaste randvoorwaarden:
- De functie is thread-safe, exception-safe en gedeclareerd als
noexcept([SWS_EM_02276]). - De meegegeven
undefinedStateCallbackmoet gedurende de gehele levensduur van de aangemaakteStateClient-instantie aanroepbaar blijven ([SWS_EM_02276]). Dit vereist bijzondere zorgvuldigheid bij bindingen aan objectinstanties (bijvoorbeeld met behulp vanstd::bind).
De instantiëring vindt synchroon plaats en levert een ara::core::Result<StateClient> op ([SWS_EM_02276]). In geval van een fout zijn de volgende foutcodes gedefinieerd:
ara::exec::ExecErrc::kInvalidArgument: Wordt gemeld wanneer het doorgegeven argument geen aanroepbare functie bevat (rollback-semantiek; verhelping door het aanbieden van een geldige functie) ([SWS_EM_02276]).ara::exec::ExecErrc::kNoCommunication: Signaleert een communicatiefout (no-rollback-semantiek; verhelping door een nieuwe poging) ([SWS_EM_02276]). Dit zal vermoedelijk te herleiden zijn tot een mislukte verbindingsopbouw met de uitvoeringsomgeving. Vraag Q-c312c2b5e7c3c7d0 (open)
Het constructiepatroon komt structureel overeen met de initialisatie-aanpak van verwante uitvoeringsclients zoals ara::exec::ExecutionClient ([SWS_EM_02562]), die eveneens met een verplichte callback via een named constructor wordt aangemaakt.
Deze gebruiksinstructie is automatisch gegenereerd op basis van de specificatiegegevens van AUTOSAR R25-11.
Implementer's Guide volgt (complexiteit 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#80fa559d- Content hash
80fa559d- 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 · Duits origineel