função 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.
O método de fábrica estático Create serve como Named Constructor para a criação de uma instância de ara::exec::StateClient ([SWS_EM_02276]). Como parâmetro obrigatório é passado undefinedStateCallback. Este callback é disparado pela biblioteca de cliente quando um grupo de funções transiciona inesperadamente – ou seja, sem solicitação prévia via SetState() – para um estado indefinido ([SWS_EM_02276]). Nessa ocasião, o grupo de funções afetado e o erro são transmitidos ao callback através de um ExecutionErrorEvent.
Para o contexto de chamada e o tempo de vida aplicam-se condições de contorno fixas:
- A função é thread-safe, exception-safe e declarada como
noexcept([SWS_EM_02276]). - O
undefinedStateCallbackpassado deve permanecer invocável durante todo o tempo de vida da instância deStateClientcriada ([SWS_EM_02276]). Isto requer cuidado especial em vinculações a instâncias de objetos (por exemplo, mediantestd::bind).
A instanciação ocorre de forma síncrona e retorna um ara::core::Result<StateClient> ([SWS_EM_02276]). Em caso de falha, são definidos os seguintes códigos de erro:
ara::exec::ExecErrc::kInvalidArgument: É reportado quando o argumento passado não contém uma função invocável (semântica de rollback; resolução mediante fornecimento de uma função válida) ([SWS_EM_02276]).ara::exec::ExecErrc::kNoCommunication: Sinaliza um erro de comunicação (semântica de no-rollback; resolução mediante nova tentativa) ([SWS_EM_02276]). Isto presumivelmente deve-se a uma falha no estabelecimento de conexão com o ambiente de execução. Pergunta Q-c312c2b5e7c3c7d0 (aberta)
O padrão de construção corresponde estruturalmente à abordagem de inicialização de clientes de execução relacionados como ara::exec::ExecutionClient ([SWS_EM_02562]), que também é criado com um callback obrigatório através de um Named Constructor.
Esta nota de uso foi gerada automaticamente com base nos dados de especificação do AUTOSAR R25-11.
Guia do implementador em breve (complexidade 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#df14ee55- Content hash
df14ee55- 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 em alemão