फ़ंक्शन DiscardPendingChanges [SWS_PER_00365] Upstream: RS_PER_00002, RS_AP_00119, RS_AP_00120, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159
ara::core::Result< void > DiscardPendingChanges () noexcept;
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.
उपयोग और सिमेंटिक्स
क्लास ara::per::KeyValueStorage ([SWS_PER_00365]) का सिंक्रोनस मेंबर फ़ंक्शन DiscardPendingChanges हेडर ara/per/key_value_storage.h के माध्यम से प्रदान किया जाता है। यह कोई पैरामीटर स्वीकार नहीं करता है और एक ara::core::Result<void> लौटाता है। इसका उद्देश्य Key-Value Storage इंस्टेंस पर उन सभी लंबित परिवर्तनों को खारिज करना है जो 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: यदि मेमोरी राइट-सुरक्षित (write-protected) है या Write-Only-Once कॉन्फ़िगरेशन में कुंजी पहले से मौजूद है।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]।
यह पाठ एक AI द्वारा जनरेट किया गया था और AUTOSAR विनिर्देश के आधार पर क्यूरेट किया गया था।
इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता I2)
| Header-Datei | #include "ara/per/key_value_storage.h" |
|---|---|
| Scope | class ara::per::KeyValueStorage |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result< void > | A Result of void. In case of an error, it contains any of the errors defined below, or a vendor specific error. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| PerErrc::kIllegalWriteAccess | 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. |
| PerErrc::kPhysicalStorageFailure | rollback_semantics Returned if access to the physical storage fails. |
| PerErrc::kIntegrityCorrupted | rollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted. |
| PerErrc::kValidationFailed | rollback_semantics Returned if the validity of stored data cannot be ensured. |
| PerErrc::kEncryptionFailed | rollback_semantics Returned if the decryption of stored data fails. |
| PerErrc::kAuthenticationFailed | rollback_semantics Returned if checking the MAC of stored data fails. |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_PER_00365- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_PER_00365@rel:R25-11#801d55da- Content hash
801d55da- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00365
Status: valid/unmigrated
Version: rel:R25-11#f3496212
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_PER_00365@rel:R25-11#f3496212
Recorded Revisions (8):
- R25-11
rel:R25-11#0793e9a52026-09-30 - R19-11
rel:R19-11#90dcd0d22026-10-14 - R20-11
rel:R20-11#306302ca2026-10-14 - R21-11
rel:R21-11#5bb9ceb52026-10-14 - R22-11
rel:R22-11#6374aaa62026-10-14 - R23-11
rel:R23-11#7a4bc2902026-10-14 - R24-11
rel:R24-11#fd18fb832026-10-14 - R25-11
rel:R25-11#f34962122026-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 · जर्मन मूल