फ़ंक्शन 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.
स्टैटिक फ़ैक्टरी method Create ara::exec::StateClient ([SWS_EM_02276]) का एक इंस्टेंस बनाने के लिए नेम्ड कंस्ट्रक्टर के रूप में कार्य करता है। अनिवार्य पैरामीटर के रूप में undefinedStateCallback पास किया जाता है। यह कॉलबैक क्लाइंट लाइब्रेरी द्वारा तब ट्रिगर किया जाता है जब कोई फ़ंक्शन समूह अप्रत्याशित रूप से - यानी SetState() के माध्यम से पूर्व अनुरोध के बिना - किसी अपरिभाषित स्थिति में परिवर्तित हो जाता है ([SWS_EM_02276])। इस दौरान, प्रभावित फ़ंक्शन समूह और त्रुटि कॉलबैक को ExecutionErrorEvent के माध्यम से प्रेषित की जाती है।
कॉल संदर्भ और जीवनकाल के लिए निश्चित रूपरेखा शर्तें लागू होती हैं:
- फ़ंक्शन थ्रेड-सुरक्षित, अपवाद-सुरक्षित है और
noexceptके रूप में घोषित है ([SWS_EM_02276])। - पास किया गया
undefinedStateCallbackबनाए गएStateClient-इंस्टेंस के पूरे जीवनकाल के दौरान कॉल करने योग्य रहना चाहिए ([SWS_EM_02276])। इसके लिए ऑब्जेक्ट इंस्टेंसेस (उदाहरण के लिएstd::bindके माध्यम से) से बाइंडिंग के मामले में विशेष सावधानी की आवश्यकता होती है।
इंस्टेंस निर्माण सिंक्रोनस रूप से होता है और एक ara::core::Result<StateClient> लौटाता है ([SWS_EM_02276])। त्रुटि के मामले में निम्नलिखित त्रुटि कोड परिभाषित हैं:
ara::exec::ExecErrc::kInvalidArgument: तब रिपोर्ट किया जाता है जब पास किए गए तर्क में कोई कॉल करने योग्य फ़ंक्शन शामिल नहीं होता है (रोलबैक सिमेंटिक्स; एक वैध फ़ंक्शन प्रदान करके समाधान) ([SWS_EM_02276])।ara::exec::ExecErrc::kNoCommunication: एक संचार त्रुटि का संकेत देता है (नो-रोलबैक सिमेंटिक्स; पुनः प्रयास करके समाधान) ([SWS_EM_02276])। यह संभवतः निष्पादन परिवेश (execution environment) के साथ कनेक्शन स्थापित करने में विफलता के कारण हो सकता है। प्रश्न Q-c312c2b5e7c3c7d0 (खुला)
निर्माण पैटर्न संरचनात्मक रूप से ara::exec::ExecutionClient ([SWS_EM_02562]) जैसे संबंधित निष्पादन क्लाइंट के इनिशियलाइज़ेशन दृष्टिकोण से मेल खाता है, जो अनिवार्य कॉलबैक के साथ एक नेम्ड कंस्ट्रक्टर के माध्यम से भी बनाया जाता है।
यह उपयोग नोट AUTOSAR R25-11 के विनिर्देश डेटा के आधार पर स्वचालित रूप से जनरेट किया गया था।
इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता 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#2e0f639d- Content hash
2e0f639d- 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 · जर्मन मूल