función 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.
Uso y semántica
La función miembro síncrona DiscardPendingChanges de la clase ara::per::KeyValueStorage ([SWS_PER_00365]) se proporciona a través del encabezado ara/per/key_value_storage.h. No toma ningún parámetro y devuelve un ara::core::Result<void>. Su finalidad es descartar todos los cambios pendientes en la instancia de Key-Value Storage que se hayan acumulado desde la última llamada a SyncToStorage o desde la apertura mediante OpenKeyValueStorage() [SWS_PER_00365].
Interacción y comportamiento transaccional
Las operaciones de escritura como SetValue [SWS_PER_00046], RemoveKey [SWS_PER_00047] y RemoveAllKeys [SWS_PER_00048] están sujetas a una semántica transaccional. Sus modificaciones solo se escriben permanentemente en el soporte de almacenamiento físico mediante la llamada a SyncToStorage [SWS_PER_00049]. A través de DiscardPendingChanges, estas modificaciones no guardadas se revierten, de modo que las consultas mediante GetCurrentValueSize vuelven a reflejar también el estado inicial transaccional anterior [SWS_PER_00554].
Tratamiento de errores y concurrencia
En caso de error, el resultado contiene un error específico del fabricante o un código de error de PerErrc con semántica de rollback definida [SWS_PER_00365]:
PerErrc::kIllegalWriteAccess: si el almacenamiento está protegido contra escritura o, en caso de configuración write-only-once, la clave ya existe.PerErrc::kPhysicalStorageFailure: si falla el acceso al medio de almacenamiento físico.PerErrc::kIntegrityCorrupted,PerErrc::kValidationFailed,PerErrc::kEncryptionFailedoPerErrc::kAuthenticationFailed: en caso de pérdida de integridad, errores de validación, errores de descifrado o comprobación MAC fallida.
El método está declarado como noexcept, seguro ante excepciones (exception safe) y seguro para subprocesos (thread-safe) [SWS_PER_00365]. No obstante, la ejecución puede retrasarse si en paralelo en otros hilos están activas llamadas a SyncToStorage, SetValue, RemoveKey, RemoveAllKeys, ResetKey o RecoverKey [SWS_PER_00365] [SWS_PER_00426] [SWS_PER_00427].
Este texto ha sido generado por una IA y curado a partir de la especificación de AUTOSAR.
Guía del implementador pendiente (complejidad 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#a34413cb- Content hash
a34413cb- 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 · Original en alemán