دالة Allocate [SWS_CM_90438] Upstream: RS_CM_00201, RS_AP_00114, RS_AP_00115, RS_AP_00120
ara::com::SampleAllocateePtr< SampleType > Allocate ();
Allocating data for event transfer when Communication Management is responsible for the data.
تُستدعى الطريقة Allocate على مستوى الهيكل (skeleton) لحدث ما ([SWS_CM_90438]؛ AUTOSAR_AP_EXP_ARAComAPI §5.4.1 «Skeleton Class API’s»)، لتخصيص ذاكرة لنقل بيانات الأحداث عندما تكون Communication Management (ara::com) مسؤولة عن إدارة البيانات ([SWS_CM_90438]). وتعيد نسخة من النوع ara::com::SampleAllocateePtr<SampleType> ([SWS_CM_90438]). يتصرف نوع المؤشر هذا مفاهيميًا مثل std::unique_ptr<T>، بحيث يكون طرف واحد فقط هو المالك للمؤشر في أي وقت (ARAComAPI §6 «Event Allocate/Send sample Binding implementer hint»).
فيما يتعلق بمعالجة الأخطاء والأمان من الاستثناءات، تم تحديد Allocate على أنها not exception safe ([SWS_CM_90438]). وتحدد المواصفة انتهاكين محتملين (Violations):
SampleAllocationViolation: لا تتوفر موارد ذاكرة كافية لتخصيص البيانات ([SWS_CM_90438]).AllocateUsageViolation: تم التخصيص بصورة غير مسموح بها عبر مخصّص معرّف من قِبل المستخدم ([SWS_CM_90438]).
يهدف المفهوم الكامن وراء Allocate أساسًا إلى دعم آليات النقل دون نسخ (Zero-Copy)، لا سيما في نقل IPC القائم على الذاكرة المشتركة، مع افتراض وجود مزامنة صارمة بين القراء والكتّاب (ARAComAPI §6 «Event Allocate/Send sample Binding implementer hint»). يجب على المنفذين مراعاة أن متطلبات التسلسل التسلسلي قد تبطل ميزة Zero-Copy، ما لم تكن أنواع البيانات مهيأة لتكون متوافقة ثنائيًا في النشر أو إذا كان منطق الكشف يستبعد ذلك (ARAComAPI §6 «Event Allocate/Send sample Binding implementer hint»).
في إطار التفاعل مع إرسال الأحداث، يتم تمرير مؤشر الذاكرة الذي تم الحصول عليه عبر Allocate إلى Send(ara::com::SampleAllocateePtr<SampleType> data) ([SWS_CM_90437]). بعد استدعاء Send، لا يجوز لتطبيق الخدمة الوصول إلى البيانات بمجرد أن ترسل Communication Management البيانات إلى جميع التطبيقات المشتركة ([SWS_CM_90437]).
تم إنشاء هذا النص بواسطة ذكاء اصطناعي ويستند حصريًا إلى وثائق المواصفات الخاصة بإصدار AUTOSAR R25-11.
دليل المنفِّذ قيد الإعداد (التعقيد I2)
| Header-Datei | #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h" |
|---|---|
| Scope | class <SI-Namespace>::skeleton:: events::<Event> |
| Exception-Sicherheit | not exception safe |
| Verletzungen (Violations) | SampleAllocation- Not enough memory resources can be allocated Violation AllocateUsageVio- The allocation was illegally done via custom allocator lation |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::com::Sample | A ara::com::SampleAllocateePtr to an event sample AllocateePtr< Sample Type > |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CM_90438- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CM_90438@rel:R25-11#d9aa76d5- Content hash
d9aa76d5- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_90438
Status: valid/unmigrated
Version: rel:R25-11#3059e6d8
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_90438@rel:R25-11#3059e6d8
Recorded Revisions (8):
- R25-11
rel:R25-11#b02a325f2026-09-30 - R19-11
rel:R19-11#b404edd72026-10-14 - R20-11
rel:R20-11#8f3783f62026-10-14 - R21-11
rel:R21-11#a234befb2026-10-14 - R22-11
rel:R22-11#340e44dd2026-10-14 - R23-11
rel:R23-11#340e44dd2026-10-14 - R24-11
rel:R24-11#2e4120f42026-10-14 - R25-11
rel:R25-11#3059e6d82026-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 · الأصل الألماني