function 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.
The static factory method Create serves as a named constructor for creating an instance of ara::exec::StateClient ([SWS_EM_02276]). As a mandatory parameter, undefinedStateCallback is passed. This callback is triggered by the client library if a function group unexpectedly—that is, without a prior request via SetState()—transitions into an undefined state ([SWS_EM_02276]). In doing so, the affected function group and the error are transmitted to the callback via a ExecutionErrorEvent.
Fixed boundary conditions apply to the invocation context and lifetime:
- The function is thread-safe, exception-safe, and declared as
noexcept([SWS_EM_02276]). - The passed
undefinedStateCallbackmust remain callable throughout the entire lifetime of the createdStateClientinstance ([SWS_EM_02276]). This requires particular care with bindings to object instances (for example by means ofstd::bind).
Instantiation occurs synchronously and returns a ara::core::Result<StateClient> ([SWS_EM_02276]). In case of error, the following error codes are defined:
ara::exec::ExecErrc::kInvalidArgument: Reported when the passed argument does not contain a callable function (rollback semantics; resolution by providing a valid function) ([SWS_EM_02276]).ara::exec::ExecErrc::kNoCommunication: Signals a communication error (no-rollback semantics; resolution by retrying) ([SWS_EM_02276]). This is likely attributable to a failed connection establishment to the execution environment. Question Q-c312c2b5e7c3c7d0 (open)
The design pattern structurally corresponds to the initialization approach of related execution clients such as ara::exec::ExecutionClient ([SWS_EM_02562]), which is likewise created with a mandatory callback via a named constructor.
This usage note was automatically generated based on specification data from AUTOSAR R25-11.
Implementer's Guide to follow (complexity 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#4f8bba6e- Content hash
4f8bba6e- 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 · German original