دالة RegisterGetHandler [SWS_CM_00114] Upstream: RS_CM_00218, RS_AP_00114, RS_AP_00120, RS_AP_00127, RS_AP_00128, RS_AP_00138
void RegisterGetHandler (std::function< ara::core::Future< FieldType >()> handler) noexcept;
Register a callback function to be invoked when a Get() request is received. The method exists only if the offered service contains a Field and Field.hasGetter ==TRUE
الاستخدام
تُستدعى الدالة RegisterGetHandler من جهة الخادم على كائن الحقل لـ Skeleton ([SWS_CM_00114]). ولا توجد في الكود المُولَّد إلا إذا تم تكوين غيتِر (Getter) للحقل المعني في وصف الواجهة (Field.hasGetter == TRUE) (EXP ARAComAPI §5.4.8.1 «Registering Getters»). ويتم تمرير رد اتصال handler من النوع std::function<ara::core::Future<FieldType>()>، والذي يتم استدعاؤه بواسطة تنفيذ الربط (Binding) عند ورود طلب Get() من جانب Proxy.
يُعد تسجيل مثل هذا المعالج اختياريًا تمامًا (EXP ARAComAPI §5.4.8.1 «Registering Getters»). عادةً لا يحتاج تنفيذ الخدمة إلى معالج غيتِر، حيث يقوم Communication Management بتخزين القيمة المحددة مؤخرًا عبر Update() مؤقتًا والرد على طلبات Proxy ذاتيًا. ويكون المعالج مفيدًا خصوصًا إذا كان تحديد قيمة الحقل مستغرقًا للوقت أو متطلبًا لعمليات حسابية مكثفة، وبالتالي ينبغي ألا يتم إلا عند الحاجة الفعلية بشكل غير متزامن عبر نمط Promise/Future.
معالجة الأخطاء والشروط الحدية
ليس للدالة قيمة إرجاع، ومُعلنة بصفتها noexcept وآمنة من الاستثناءات (exception safe) ([SWS_CM_00114]). وإذا كان الكائن القابل للاستدعاء المُمرَّر غير موجود أو بقيمة null، فسيحدث الخطأ InvalidHandlerViolation ([SWS_CM_00114]).
تفاعل
على النقيض من RegisterSetHandler، الذي يُعد استدعاؤه إلزاميًا عند وجود سِتِر (Setter) (EXP ARAComAPI §5.4.8.2 «Registering Setters»)، يظل RegisterGetHandler اختياريًا تمامًا. وإذا كان من المقرر معالجة المعالج في سياق تنفيذ محدد بشكل غير متزامن، تتوفر بالإضافة إلى ذلك دالة القالب ذات التحميل الزائد مع ExecutorT ([SWS_CM_11360]).
تم إنشاء ملاحظة الاستخدام هذه بواسطة ذكاء اصطناعي استنادًا إلى مواصفة AUTOSAR R25-11.
دليل المنفِّذ قيد الإعداد (التعقيد I2)
| Header-Datei | #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h" |
|---|---|
| Scope | class <SI-Namespace>::skeleton:: fields::<Field> |
| Exception-Sicherheit | exception safe |
| Verletzungen (Violations) | InvalidHandlerVio- Provided Callable handler does not exist or is null lation |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| handler | The callback function to be invoked to process the Field get request |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| None |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CM_00114- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CM_00114@rel:R25-11#f95598b7- Content hash
f95598b7- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00114
Status: valid/unmigrated
Version: rel:R25-11#c6386380
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_CM_00114@rel:R25-11#c6386380
Recorded Revisions (8):
- R25-11
rel:R25-11#417163c72026-09-30 - R19-11
rel:R19-11#f07f56a32026-10-14 - R20-11
rel:R20-11#cdd125c72026-10-14 - R21-11
rel:R21-11#cdd125c72026-10-14 - R22-11
rel:R22-11#6a153b112026-10-14 - R23-11
rel:R23-11#23956e7c2026-10-14 - R24-11
rel:R24-11#5d29d0102026-10-14 - R25-11
rel:R25-11#c63863802026-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 · الأصل الألماني