يدير أزواج المفتاح والقيمة المستمرة عبر عمليات قراءة وكتابة معاملاتية مع مزامنة صريحة.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 74f93d55aa8aالمصدرأسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
يدير أزواج المفتاح والقيمة المستمرة عبر عمليات قراءة وكتابة معاملاتية مع مزامنة صريحة.
توفر الفئة مخزن مفتاح-قيمة يعمل بأسلوب المعاملات، ولا تتم كتابة تعديلاته على وسيط التخزين المادي إلا عبر SyncToStorage() أو يتم تجاهلها عبر DiscardPendingChanges()[SWS_PER_00049]، [SWS_PER_00365]. النسخ غير قابلة للنسخ أو النقل وتوفر طرق وصول آمنة بالنسبة للخيوط، ولكنها تتطلب استبعاد الاستدعاءات المتزامنة عند التدمير [SWS_PER_00322]، [SWS_PER_00050]. في حالة حدوث أعطال في العتاد أثناء المزامنة، لا تسري بعد ذلك أي دلالات تراجع تلقائي [SWS_PER_00049].
السياق
توفر الفئة ara::per::KeyValueStorage مخزن مفتاح-قيمة ذا نوع محدد ضمن Adaptive Platform الخاصة بـ AUTOSAR، والتي تدير البيانات المستمرة كمجموعة من المفاتيح ذات قيم مقترنة بها. وهي تعمل كواجهة أساسية للتطبيقات لتخزين بيانات التطبيق المكوّنة واسترجاعها بصورة مستمرة. يتم الوصول بدلالات المعاملات عبر حالة معاملة داخلية بدلاً من الوصول المباشر إلى وسيط التخزين المادي، كما هو محدد لعمليات القراءة في [SWS_PER_00042]، [SWS_PER_00043]، [SWS_PER_00044]، [SWS_PER_00332] و[SWS_PER_00554]. العمليات المعدِّلة يكون لها في البداية تأثير معاملاتي بحت ولا تغير التخزين المادي إلا عند إجراء مزامنة صريحة [SWS_PER_00046]، [SWS_PER_00047]، [SWS_PER_00048]، [SWS_PER_00049].
دورة الحياة
يخضع إنشاء نسخ ara::per::KeyValueStorage وملكيتها لقيود صارمة: فكل من المنشئ الافتراضي [SWS_PER_00459] وكذلك منشئ النسخ ومنشئ النقل [SWS_PER_00324]، [SWS_PER_00322] محذوفة (=delete). وبالمثل، تم حذف عوامل تعيين النسخ والنقل صراحةً [SWS_PER_00325]، [SWS_PER_00323]. وبالتالي، لا يمكن نسخ النسخ أو نقلها. يتم إنشاء كائن التخزين عبر التهيئة بواسطة OpenKeyValueStorage()، والتي تحدد أيضًا نقطة البداية للتغييرات المعلقة [SWS_PER_00365]. تم تحديد المدمر [SWS_PER_00050] على أنه آمن ضد الاستثناءات، ولكنه ليس آمنًا بالنسبة للخيوط صراحةً؛ لذلك، يجب ألا يحدث التدمير إلا عندما لا تكون هناك عمليات وصول متوازية قيد التشغيل. في التشغيل العادي، تم تصميم جميع طرق الوصول لتكون آمنة بالنسبة للخيوط، ولكنها قد تتأخر في حالة وجود استدعاءات كتابة أو مزامنة متزامنة من خيوط أخرى [SWS_PER_00046]، [SWS_PER_00049]، [SWS_PER_00365].
مسار الاستخدام
يتضمن مسار الاستخدام النموذجي تعيين قيم البيانات أو تحديثها، والفحص أو القراءة الاختيارية لحالة المعاملة الحالية، ثم الكتابة المستمرة النهائية للتغييرات أو تجاهلها. باستخدام SetValue<T>()، يتم تعيين زوج مفتاح-قيمة أو استبداله في سياق المعاملة الحالي [SWS_PER_00046]. يمكن فحص المفاتيح الموجودة عبر KeyExists()[SWS_PER_00043]، وتحديد حجمها بالبايت عبر GetCurrentValueSize()[SWS_PER_00554]، وقراءة قيمها عبر التحميلات الزائدة الآمنة من حيث النوع لـ GetValue<T>()[SWS_PER_00044]، [SWS_PER_00332]. يؤدي استدعاء SyncToStorage() فقط إلى نقل جميع التغييرات المتراكمة بشكل ذري إلى وسيط التخزين المادي [SWS_PER_00049]. أما إذا كان المطلوب تجاهل التغييرات غير المتزامنة، فإن DiscardPendingChanges() يعيد الحالة إلى وضع آخر SyncToStorage() أو إلى وضع الفتح [SWS_PER_00365].
ترجع جميع الطرق الأخطاء عبر ara::core::Result. ويتم التمييز بدقة بين العمليات ذات ضمان التراجع والأخطاء بدون تراجع:
أخطاء التكوين والحماية من الكتابة: عند استدعاء طرق الكتابة على وحدة تخزين للقراءة فقط أو عند وجود المفتاح بالفعل في تكوينات الكتابة لمرة واحدة فقط (Write-Only-Once)، تفشل العملية مع PerErrc::kIllegalWriteAccess[SWS_PER_00046]، [SWS_PER_00047]، [SWS_PER_00048]، [SWS_PER_00049].
تعارضات الأنواع وتوافر المفاتيح: إذا كان نوع البيانات لا يتطابق مع النوع المخزن أثناء الكتابة فوقها أو القراءة، يحدث PerErrc::kDataTypeMismatch[SWS_PER_00044]، [SWS_PER_00332]، [SWS_PER_00046]. تبلغ المفاتيح غير الموجودة عن PerErrc::kKeyNotFound[SWS_PER_00044]، [SWS_PER_00554]. وفي ResetKey()، يتم إطلاق PerErrc::kInitValueNotAvailable إذا لم يتم تحديد قيمة أولية [SWS_PER_00426].
انتهاكات المساحة التخزينية والحصص النسبية: إذا تجاوز حجم البيانات الجديد الحد المكوّن maximumAllowedSize، يتم الإبلاغ عن PerErrc::kQuotaExceeded[SWS_PER_00046]، [SWS_PER_00049]. وإذا لم تكن مساحة التخزين المادية كافية، يُرجع SyncToStorage() أو RecoverKey() الخطأ PerErrc::kOutOfStorageSpace بدون دلالات التراجع [SWS_PER_00049]، [SWS_PER_00427].
أخطاء السلامة والتشفير والعتاد: تتمتع أخطاء الوصول المادي (PerErrc::kPhysicalStorageFailure) بدلالات تراجع أثناء عمليات القراءة وSetValue()[SWS_PER_00046]، بينما لا تتمتع بدلالات تراجع عند SyncToStorage()[SWS_PER_00049]. يتم الإشارة إلى تلف البنية (PerErrc::kIntegrityCorrupted)، أو أخطاء فك التشفير (PerErrc::kEncryptionFailed)، أو فشل عمليات فحص MAC (PerErrc::kAuthenticationFailed) بواسطة عمليات القراءة والكتابة والاسترداد مثل RecoverKey()[SWS_PER_00427].
تم إنشاء هذا الدليل بواسطة نظام توثيق مدعوم بالذكاء الاصطناعي استنادًا إلى AUTOSAR R25-11.
Removes all pending changes to this Key-Value Storage since the last call to SyncToStorage() or since this Key-Value Storage was opened using OpenKeyValueStorage(). DiscardPendingChanges may be delayed by an ongoing call from another thread to RemoveAll Keys, SyncToStorage, DiscardPendingChanges, SetValue, GetValue, GetCurrentValueSize, RemoveKey, RecoverKey, or ResetKey.
Returns a list of all currently available keys of this Key-Value Storage. The list of keys is only accurate if no key-value pair is added or deleted at the same time. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Returns the size (in bytes) of the value assigned to a key of this Key-Value Storage. GetCurrentValueSize may be delayed by an ongoing call from another thread to RemoveAllKeys or DiscardPendingChanges, or to SetValue, RemoveKey, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Returns the value assigned to a key of this KeyValueStorage. This method should only be used to access very large values repeatedly. GetValue may be delayed by an ongoing call from another thread to RemoveAllKeys or Discard PendingChanges, or to SetValue, RemoveKey, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Checks if a key-value pair exists in this Key-Value Storage. The result is only accurate if no key-value pair is added or deleted at the same time. E.g. when a key-value pair is removed in another thread directly after this function returned "true", the result is not valid anymore. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Recovers a single key-value pair of this Key Value Storage. This method allows to recover a single key-value pair when the redundancy checks fail. This method does a best-effort recovery of the key-value pair. After recovery, the key-value pair might contain outdated or initial content, or might be lost. RecoverKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair.
Removes all key-value pairs and associated values from this Key-Value Storage. RemoveAllKeys may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncToStorage, DiscardPendingChanges, SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
Removes a key and the associated value from this Key-Value Storage. RemoveKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
Resets a key of this Key-Value Storage to its initial value. ResetKey allows to reset a single key to its initial value. If the key is currently not available in the Key-Value Storage, it is re-created. Afterwards, the key-value pair will appear in both cases as if it was newly installed from the current Target Configuration. ResetKey will fail with kInitValueNotAvailable when neither Application Design nor Target Configuration define an initial value for the key. ResetKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair.
Stores a key-value pair in this Key-Value Storage. If a value already exists and has the same data type as the new value, it is overwritten. If the new value has a different data type than the stored value, kDataTypeMismatch is returned. SetValue may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
Flushes changed key-value pairs of the Key-Value Storage to the physical storage. SyncToStorage may be delayed by an ongoing call from another thread to RemoveAllKeys, DiscardPendingChanges, SetValue, RemoveKey, RecoverKey, or ResetKey.
Removes all pending changes to this Key-Value Storage since the last call to SyncToStorage() or since this Key-Value Storage was opened using OpenKeyValueStorage(). DiscardPendingChanges may be delayed by an ongoing call from another thread to RemoveAll Keys, SyncToStorage, DiscardPendingChanges, SetValue, GetValue, GetCurrentValueSize, RemoveKey, RecoverKey, or ResetKey.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 73a36630080aالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
الاستخدام والدلالات
يتم توفير دالة العضو المتزامنة DiscardPendingChanges للفئة ara::per::KeyValueStorage ([SWS_PER_00365]) عبر ملف الترويسة ara/per/key_value_storage.h. وهي لا تأخذ أي معلمات وتُرجع ara::core::Result<void>. والغرض منها هو تجاهل جميع التغييرات المعلقة في مثيل تخزين المفتاح-القيمة، والتي تراكمت منذ آخر استدعاء لـ SyncToStorage أو منذ الفتح باستخدام OpenKeyValueStorage()[SWS_PER_00365].
التفاعل وسلوك المعاملات
تخضع عمليات الكتابة مثل SetValue[SWS_PER_00046] وRemoveKey[SWS_PER_00047] وRemoveAllKeys[SWS_PER_00048] لدلالات المعاملات. ولا تُكتب تغييراتها بشكل دائم على وسيط التخزين المادي إلا من خلال استدعاء SyncToStorage[SWS_PER_00049]. ومن خلال DiscardPendingChanges، يتم التراجع عن هذه التعديلات غير المحفوظة، بحيث تعكس الاستعلامات عبر GetCurrentValueSize أيضًا الحالة الأولية السابقة للمعاملة [SWS_PER_00554].
معالجة الأخطاء والتزامن
في حالة حدوث خطأ، تحتوي النتيجة على خطأ خاص بالشركة المصنعة أو كود خطأ من PerErrc مع دلالات تراجع محددة [SWS_PER_00365]:
PerErrc::kIllegalWriteAccess: إذا كانت وحدة التخزين محمية ضد الكتابة أو إذا كان المفتاح موجودًا بالفعل في حالة تكوين الكتابة لمرة واحدة فقط.
PerErrc::kPhysicalStorageFailure: إذا فشل الوصول إلى وسيط التخزين المادي.
PerErrc::kIntegrityCorrupted أو PerErrc::kValidationFailed أو PerErrc::kEncryptionFailed أو PerErrc::kAuthenticationFailed: عند فقدان السلامة أو أخطاء التحقق من الصحة أو أخطاء فك التشفير أو فشل فحص MAC.
تم التصريح عن الطريقة كـ noexcept، وهي آمنة من الاستثناءات (exception safe) وكذلك آمنة خيطيًا (thread-safe) [SWS_PER_00365]. ومع ذلك، قد يتأخر التنفيذ إذا كانت هناك استدعاءات نشطة بالتوازي في خيوط أخرى لـ SyncToStorage أو SetValue أو RemoveKey أو RemoveAllKeys أو ResetKey أو RecoverKey[SWS_PER_00365][SWS_PER_00426][SWS_PER_00427].
تم إنشاء هذا النص بواسطة ذكاء اصطناعي وتم تنقيحه بالاستناد إلى مواصفة AUTOSAR.
rollback_semantics Returned if the Key-Value Storage is configured as read- only, or if it is configured as write-only-once and the key already exists.
Returns a list of all currently available keys of this Key-Value Storage. The list of keys is only accurate if no key-value pair is added or deleted at the same time. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Returns the size (in bytes) of the value assigned to a key of this Key-Value Storage. GetCurrentValueSize may be delayed by an ongoing call from another thread to RemoveAllKeys or DiscardPendingChanges, or to SetValue, RemoveKey, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Returns the value assigned to a key of this KeyValueStorage. This method should only be used to access very large values repeatedly. GetValue may be delayed by an ongoing call from another thread to RemoveAllKeys or Discard PendingChanges, or to SetValue, RemoveKey, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Returns the value assigned to a key of this Key-Value Storage. GetValue may be delayed by an ongoing call from another thread to RemoveAllKeys or Discard PendingChanges, or to SetValue, RemoveKey, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
Checks if a key-value pair exists in this Key-Value Storage. The result is only accurate if no key-value pair is added or deleted at the same time. E.g. when a key-value pair is removed in another thread directly after this function returned "true", the result is not valid anymore. This method uses transaction semantics, it sees the current state of transaction, not the actual physical storage.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: d5f804c0cf2dالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تتحقق الطريقة المتزامنة KeyExists للفئة ara::per::KeyValueStorage مما إذا كان زوج مفتاح-قيمة معين موجوداً في وحدة التخزين [SWS_PER_00043]. ويتم تمرير المفتاح المراد التحقق منه key من النوع ara::core::StringView كمعلمة إدخال [SWS_PER_00043]. وقيمة الإرجاع هي ara::core::Result<bool> يحتوي على true إذا أمكن تحديد موقع المفتاح، وإلا فإنه يحتوي على false[SWS_PER_00043]. الدالة مُعلنة كـ const بالإضافة إلى noexcept وهي آمنة من الاستثناءات (exception safe) [SWS_PER_00043].
فيما يتعلق بالدلالات اللفظية والتزامن، تعمل KeyExists بناءً على المعاملات: فهي تعكس الحالة الحالية للمعاملة وليس بالضرورة وحدة التخزين الفعلية [SWS_PER_00043]. وعلى الرغم من أن التنفيذ آمن لخيوط المعالجة (thread-safe)، فإن النتيجة المقدمة تكون دقيقة فقط إذا لم تتم إضافة أزواج مفتاح-قيمة أو حذفها في نفس الوقت [SWS_PER_00043]. على سبيل المثال، إذا تمت إزالة الزوج في خيط معالجة آخر مباشرة بعد إرجاع true، تفقد النتيجة صلاحيتها [SWS_PER_00043].
في حالة حدوث خطأ، يحتوي Result على رمز خطأ محدد [SWS_PER_00043]:
StorageFailure: خطأ أثناء الوصول إلى وحدة التخزين الفعلية [SWS_PER_00043].
PerErrc::kIntegrityCorrupted: لا يمكن قراءة البيانات المخزنة بسبب انتهاك السلامة الهيكلية [SWS_PER_00043].
PerErrc::kValidationFailed: لا يمكن ضمان صلاحية البيانات المخزنة [SWS_PER_00043].
PerErrc::kEncryptionFailed: فشل فك تشفير البيانات [SWS_PER_00043].
PerErrc::kAuthenticationFailed: فشل التحقق من MAC [SWS_PER_00043].
يمكن أيضاً إرجاع أخطاء خاصة بالشركة المصنعة (vendor specific error) [SWS_PER_00043].
تم إنشاء هذا النص بواسطة ذكاء اصطناعي ويستند إلى مواصفة AUTOSAR R25-11.
A Result containing true if the key could be located or false if it couldn’t. In case of an error, it contains any of the errors defined below, or a vendor specific error.
Recovers a single key-value pair of this Key Value Storage. This method allows to recover a single key-value pair when the redundancy checks fail. This method does a best-effort recovery of the key-value pair. After recovery, the key-value pair might contain outdated or initial content, or might be lost. RecoverKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 424fba0f9a95المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تُستخدم الطريقة المتزامنة RecoverKey للفئة ara::per::KeyValueStorage للاستعادة بأفضل جهد لزوج فردي من المفتاح والقيمة عند فشل فحوصات التكرار الداخلية [SWS_PER_00427]. وتستقبل معرّف المفتاح عبر المعامل key كـ ara::core::StringView وتبلغ عن النجاح أو الخطأ عبر ara::core::Result<void>[SWS_PER_00427]. وبعد الاستعادة، قد يحتوي الزوج على محتويات قديمة أو قيم أولية أو قد يُفقد تمامًا [SWS_PER_00427].
إذا حدث خطأ، تُرجع النتيجة رموز خطأ محددة من PerErrc أو أخطاء خاصة بالشركة المصنعة [SWS_PER_00427]:
kKeyNotFound: المفتاح المحدد غير موجود في التخزين [SWS_PER_00427].
kIllegalWriteAccess: تم تكوين الذاكرة كـ للقراءة فقط (read-only) [SWS_PER_00427].
kPhysicalStorageFailure: فشل الوصول إلى الذاكرة الفعلية [SWS_PER_00427].
kIntegrityCorrupted: تمنع أضرار السلامة الهيكلية كتابة البيانات [SWS_PER_00427].
kEncryptionFailed أو kAuthenticationFailed: فشل التشفير أو فك التشفير أو التحقق من صحة MAC [SWS_PER_00427].
kOutOfStorageSpace أو kQuotaExceeded: الذاكرة المادية المتاحة غير كافية أو تم تجاوز الحد الأقصى للحجم المكوّن [SWS_PER_00427].
Removes all key-value pairs and associated values from this Key-Value Storage. RemoveAllKeys may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncToStorage, DiscardPendingChanges, SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 0ae35af4fc43المصدرأسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
الاستخدام ودلالات المعاملات
تزيل الدالة RemoveAllKeys للفئة ara::per::KeyValueStorage كافة أزواج المفتاح-القيمة ومحتوياتها المرتبطة من الذاكرة [SWS_PER_00048]. يتم استدعاء الدالة بشكل متزامن، ولا تحتوي على أي معلمات تمرير، وهي محددة بـ noexcept[SWS_PER_00048]. تخضع العملية لدلالات المعاملات (Transaktionssemantik): لا يصبح حذف جميع المفاتيح ساريًا بشكل دائم في الذاكرة الفعلية إلا بمجرد استدعاء SyncToStorage[SWS_PER_00049] لاحقًا [SWS_PER_00048]. وداخل المعاملة الجارية، تعكس عمليات القراءة مثل GetValue[SWS_PER_00332] أو استعلامات الحجم عبر GetCurrentValueSize[SWS_PER_00554] الحالة الفارغة مباشرةً [SWS_PER_00044].
معالجة الأخطاء
يُستخدم ara::core::Result<void>[SWS_PER_00048] كقيمة إرجاع. وإذا حدث خطأ، يتم تطبيق دلالات التراجع (Rollback-Semantik) [SWS_PER_00048]. وتشمل الأخطاء المحتملة ما يلي:
PerErrc::kPhysicalStorageFailure عند حدوث أخطاء أثناء الوصول إلى وسيط التخزين الفعلي [SWS_PER_00048]،
PerErrc::kIntegrityCorrupted في حالة تلف السلامة الهيكلية للبيانات [SWS_PER_00048]،
PerErrc::kEncryptionFailed وكذلك PerErrc::kAuthenticationFailed في حالات فشل التشفير/فك التشفير أو فحص MAC [SWS_PER_00048]، بالإضافة إلى الأخطاء الخاصة بالشركة المصنعة.
Removes a key and the associated value from this Key-Value Storage. RemoveKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: ea5f39b17dd8المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تُستخدم دالة العضو المتزامنة RemoveKey للفئة ara::per::KeyValueStorage لإزالة مفتاح والقيمة المقترنة به من Key-Value Storage [SWS_PER_00047]. وهي تستقبل معرف المفتاح المراد إزالته كـ ara::core::StringView عبر المعامل key وتُرجع ara::core::Result<void>[SWS_PER_00047].
تخضع العملية لدلالات المعاملات: لا تصبح التغييرات مستمرة في وحدة التخزين الفعلية على الفور، بل تسري فقط عند استدعاء SyncToStorage صراحةً [SWS_PER_00047]، والذي يقوم بمزامنة أزواج المفاتيح والقيم المعدلة [SWS_PER_00049]. يمكن التراجع عن التغييرات المعلقة قبل المزامنة باستخدام DiscardPendingChanges[SWS_PER_00365]. تعمل عمليات الوصول للقراءة مثل GetValue[SWS_PER_00044]، أو [SWS_PER_00332]، أو GetCurrentValueSize[SWS_PER_00554] أيضًا على حالة المعاملة وتعكس الحذف مباشرة.
فيما يتعلق بالتزامن، حُددت الطريقة بأنها آمنة من حيث خيوط التنفيذ (thread-safe) وآمنة من حيث الاستثناءات (exception safe) [SWS_PER_00047]. قد يتأخر الاستدعاء إذا تم تنفيذ RemoveAllKeys أو SyncToStorage أو DiscardPendingChanges بالتوازي في خيط تنفيذ آخر، أو إذا وصلت عمليات مثل SetValue أو GetValue أو GetCurrentValueSize أو RemoveKey أو RecoverKey أو ResetKey إلى نفس زوج المفتاح والقيمة في نفس الوقت [SWS_PER_00047].
إذا حدث خطأ أثناء التنفيذ، تسري دلالات التراجع ويحتوي كائن النتيجة المرجع على رمز خطأ [SWS_PER_00047]:
PerErrc::kKeyNotFound: المفتاح المحدد غير موجود في التخزين [SWS_PER_00047].
PerErrc::kIllegalWriteAccess: تمت تهيئة Key-Value Storage للقراءة فقط (read-only) [SWS_PER_00047].
PerErrc::kPhysicalStorageFailure: فشل الوصول إلى وسيط التخزين الفعلي [SWS_PER_00047].
PerErrc::kIntegrityCorrupted: تفشل الكتابة بسبب تلف السلامة الهيكلية [SWS_PER_00047].
PerErrc::kEncryptionFailed أو PerErrc::kAuthenticationFailed: يفشل التشفير أو فك التشفير أو يكون حساب/فحص MAC غير صحيح [SWS_PER_00047].
يعتمد إشعار الاستخدام هذا حصريًا على مواصفات منصة AUTOSAR Adaptive للإصدار R25-11.
Resets a key of this Key-Value Storage to its initial value. ResetKey allows to reset a single key to its initial value. If the key is currently not available in the Key-Value Storage, it is re-created. Afterwards, the key-value pair will appear in both cases as if it was newly installed from the current Target Configuration. ResetKey will fail with kInitValueNotAvailable when neither Application Design nor Target Configuration define an initial value for the key. ResetKey may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: ddb1025237e2المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
الاستخدام
تعيد الطريقة المتزامنة ResetKey تعيين زوج فردي من المفتاح والقيمة في مثيل من ara::per::KeyValueStorage إلى قيمته الأولية [SWS_PER_00426]. ويُمرر المعرّف key كمعامل بصيغة ara::core::StringView[SWS_PER_00426]. وإذا لم يكن المفتاح موجودًا حاليًا في الذاكرة، فسيتم إنشاؤه من جديد. وفي كلتا الحالتين، تطابق حالة الإدخال بعد ذلك حالة التثبيت الجديد من Target Configuration الحالي [SWS_PER_00426]. تم الإعلان عن الدالة كـ noexcept وتُرجع ara::core::Result<void>[SWS_PER_00426].
معالجة الأخطاء
في حال حدوث خطأ أثناء التنفيذ، يُرجع كائن النتيجة رمز خطأ مطابقًا [SWS_PER_00426]:
PerErrc::kInitValueNotAvailable: إذا لم تكن هناك قيمة أولية محددة للمفتاح سواء في Application Design أو في Target Configuration (دلالات التراجع) [SWS_PER_00426].
kIllegalWrite: إذا كان مخزن Key-Value Storage مكوّنًا كـ للقراءة فقط (read-only) [SWS_PER_00426].
PerErrc::kPhysicalStorageFailure أو PerErrc::kOutOfStorageSpace: عند حدوث أخطاء في الوصول إلى الذاكرة المادية أو عدم كفاية مساحة التخزين (دون دلالات التراجع) [SWS_PER_00426].
PerErrc::kIntegrityCorrupted، أو PerErrc::kEncryptionFailed، أو PerErrc::kAuthenticationFailed، أو PerErrc::kQuotaExceeded: عند حدوث انتهاكات للسلامة، أو أخطاء في التشفير والمصادقة، أو تجاوز AllowedSize المكوّن (في كل حالة مع دلالات التراجع) [SWS_PER_00426].
Stores a key-value pair in this Key-Value Storage. If a value already exists and has the same data type as the new value, it is overwritten. If the new value has a different data type than the stored value, kDataTypeMismatch is returned. SetValue may be delayed by an ongoing call from another thread to RemoveAllKeys, SyncTo Storage, or DiscardPendingChanges, or to SetValue, GetValue, GetCurrentValueSize, Remove Key, RecoverKey, or ResetKey for the same key-value pair. This method uses transaction semantics, the changes only take effect when SyncToStorage is called.
Flushes changed key-value pairs of the Key-Value Storage to the physical storage. SyncToStorage may be delayed by an ongoing call from another thread to RemoveAllKeys, DiscardPendingChanges, SetValue, RemoveKey, RecoverKey, or ResetKey.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 31e98920341cالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تكتب الطريقة المتزامنة SyncToStorage للفئة ara::per::KeyValueStorage أزواج المفاتيح والقيم المعدلة من المخزن المؤقت في الذاكرة بشكل دائم في التخزين الفعلي [SWS_PER_00049]. لا تأخذ أي معاملات وتُرجع ara::core::Result<void>، وهي معلنة كـ noexcept ومحددة بأنها آمنة من حيث الاستثناءات وآمنة من حيث خيوط التنفيذ [SWS_PER_00049].
التفاعل ودلالات المعاملات
تستخدم العمليات التعديلية مثل SetValue[SWS_PER_00046] وRemoveKey[SWS_PER_00047] وRemoveAllKeys[SWS_PER_00048] دلالات المعاملات (transaction semantics). ولا تصبح تغييراتها نافذة إلا عند استدعاء SyncToStorage[SWS_PER_00046]. وإذا كان يتعين تجاهل التعديلات المعلقة قبل الكتابة، فيمكن استدعاء DiscardPendingChanges كبديل [SWS_PER_00365].
التزامن
على الرغم من أن الدالة آمنة خيطيًا (thread-safe)، فقد يتأخر التنفيذ إذا كانت هناك عمليات نشطة بالتوازي في خيط آخر مثل SetValue أو RemoveKey أو RemoveAllKeys أو DiscardPendingChanges أو RecoverKey أو ResetKey[SWS_PER_00049].
أخطاء ذات دلالات التراجع (يتم التراجع عن التغييرات): PerErrc::kIntegrityCorrupted وPerErrc::kEncryptionFailed وPerErrc::kAuthenticationFailed وPerErrc::kQuotaExceeded بالإضافة إلى PerErrc::kIllegalWrite[SWS_PER_00049].
أخطاء بدون دلالات التراجع: PerErrc::kPhysicalStorageFailure عند أخطاء الوصول المادي وPerErrc::kOutOfStorageSpace عند عدم كفاية مساحة التخزين [SWS_PER_00049].
أخطاء التكوين: كود الخطأ Access عندما تكون وحدة التخزين مهيأة للقراءة فقط (read-only) أو في حالة الكتابة لمرة واحدة فقط (write-only-once) إذا كان المفتاح موجودًا بالفعل [SWS_PER_00049].
تم إنشاء ملاحظة الاستخدام هذه آليًا استنادًا إلى مواصفة AUTOSAR R25-11.
gemini-3.8-flash-low· 2026-10-13 · الأصل الألماني