función 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.
El método de fábrica estático Create sirve como constructor con nombre (Named Constructor) para crear una instancia de ara::exec::StateClient ([SWS_EM_02276]). Como parámetro obligatorio se pasa undefinedStateCallback. La biblioteca cliente activa este callback cuando un grupo de funciones cambia inesperadamente (es decir, sin una solicitud previa mediante SetState()) a un estado no definido ([SWS_EM_02276]). El grupo de funciones afectado y el error se transmiten al callback a través de un ExecutionErrorEvent.
Para el contexto de llamada y el ciclo de vida se aplican condiciones marco fijas:
- La función es thread-safe, exception-safe y está declarada como
noexcept([SWS_EM_02276]). - El
undefinedStateCallbackpasado debe permanecer invocable durante toda la vida útil de la instancia deStateClientcreada ([SWS_EM_02276]). Esto requiere especial cuidado en las vinculaciones a instancias de objetos (por ejemplo, mediantestd::bind).
La instanciación se realiza de forma síncrona y devuelve un ara::core::Result<StateClient> ([SWS_EM_02276]). En caso de error, se definen los siguientes códigos de error:
ara::exec::ExecErrc::kInvalidArgument: Se notifica cuando el argumento pasado no contiene una función invocable (semántica de reversión; solución mediante el suministro de una función válida) ([SWS_EM_02276]).ara::exec::ExecErrc::kNoCommunication: Señaliza un error de comunicación (semántica sin reversión; solución mediante reintento) ([SWS_EM_02276]). Es de suponer que esto se deba a un intento fallido de establecer conexión con el entorno de ejecución. Pregunta Q-c312c2b5e7c3c7d0 (abierta)
El patrón de diseño corresponde estructuralmente al enfoque de inicialización de clientes de ejecución relacionados como ara::exec::ExecutionClient ([SWS_EM_02562]), que también se crea con un callback obligatorio a través de un constructor con nombre (Named Constructor).
Esta nota de uso se generó automáticamente sobre la base de los datos de especificación de AUTOSAR R25-11.
Guía del implementador pendiente (complejidad 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#c8da5cb7- Content hash
c8da5cb7- 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 en alemán