DEENESPTFRRUARHIKOZHNL

clase ara::per::WriteAccessor

[SWS_PER_00595] Upstream: RS_PER_00004, RS_AP_00122, RS_AP_00146

class WriteAccessor final :              public virtual FileAccessor {...};

WriteAccessor is used to write file data. It provides the WriteBinary and WriteText methods featuring a Result for controlled, unformatted writing, and the operator<< method for simple formatted writing. It also provides SyncToFile() to flush the buffer of the operating system to the physical storage.

Header-Datei#include "ara/per/write_accessor.h"
Forwarding-Header#include "ara/per/per_fwd.h"
Scopenamespace ara::per
Basisklasse(n)FileAccessor

Guía del usuarioGENERADO POR IA

Sirve para la escritura en búfer de archivos binarios y de texto, así como para su sincronización en el almacenamiento físico.
GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: fd57dd10b948 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

Sirve para la escritura en búfer de archivos binarios y de texto, así como para su sincronización en el almacenamiento físico.

La clase ara::per::WriteAccessor permite escribir contenidos de archivo binarios o textuales en el módulo de persistencia y proporciona métodos para accesos de escritura no formateados, así como un operador de flujo formateado [SWS_PER_00423]. Dado que las operaciones de escritura pueden almacenarse inicialmente en el búfer del sistema operativo, la llamada a SyncToFile() fuerza el volcado permanente al almacenamiento físico [SWS_PER_00122]. Todos los métodos son seguros frente a excepciones, pero no son seguros para subprocesos, por lo que los accesos concurrentes deben ser protegidos por la aplicación.

Contexto

ara::per::WriteAccessor es una clase final del módulo de persistencia (per) de la AUTOSAR Adaptive Platform y deriva virtualmente de FileAccessor. La clase proporciona operaciones de escritura para contenidos de archivo. Ofrece métodos para escritura no formateada y controlada con gestión de errores a través de ara::core::Result, así como un operador de flujo sobrecargado para escritura formateada. Como interlocutores actúan la aplicación llamante, el búfer de archivos interno del sistema operativo y el medio de almacenamiento físico.

Ciclo de vida

El constructor por defecto de WriteAccessor está explícitamente eliminado y no debe utilizarse [SWS_PER_00596]. (Interpretación: las instancias de WriteAccessor deberían crearse y suministrarse a través de métodos de factoría de unidades de gestión de persistencia de nivel superior, como el almacenamiento de archivos). Pregunta Q-af92be8494274611 (abierta)

La destrucción se realiza a través del destructor virtual ~WriteAccessor() [SWS_PER_00597]. La clase y sus métodos están especificados como seguros frente a excepciones («exception safe») y declarados como noexcept. Con respecto a la concurrencia, WriteAccessor no es seguro para subprocesos («not thread-safe») [SWS_PER_00597]; los accesos paralelos a la misma instancia deben ser protegidos externamente por la aplicación.

Ruta de uso

El flujo regular comprende la escritura de datos en modo no formateado o formateado, el ajuste opcional del tamaño del archivo y el almacenamiento persistente final:

  • Escribir datos binarios: a través de WriteBinary() se escribe un rango de bytes (ara::core::Span<const ara::core::Byte>) en el archivo [SWS_PER_00423].
  • Escribir datos de texto: mediante WriteText() se pasan cadenas de caracteres a través de un ara::core::StringView [SWS_PER_00166]. Adicionalmente, se dispone de operator<< como función de conveniencia para casos de uso no críticos, en los que los errores que se produzcan se ignoran silenciosamente [SWS_PER_00125].
  • Forzar la persistencia: el momento del almacenamiento físico depende de la implementación de la persistencia; SyncToFile() vuelca de forma vinculante el búfer del sistema operativo al medio de almacenamiento [SWS_PER_00122], [SWS_PER_00423], [SWS_PER_00166].
  • Ajustar el tamaño del archivo: con SetFileSize() se puede truncar el archivo, eliminando los contenidos sobrantes; la posición del archivo permanece inalterada o se establece en la última posición válida o en 0 [SWS_PER_00428].
Flujo típico al escribir y sincronizar contenidos de archivoAplicaciónWriteAccessorSpeichermediumWriteBinary(b) / WriteText(s)ara::core::Result<void>SyncToFile()Betriebssystem-Puffer flashenEstado / confirmaciónara::core::Result<void>

Diagrama de secuencias: operaciones de escritura con posterior sincronización en el almacenamiento físico. Fuentes: [SWS_PER_00423], [SWS_PER_00166], [SWS_PER_00122]

Escenarios de error

Los métodos WriteBinary(), WriteText(), SyncToFile() y SetFileSize() devuelven un ara::core::Result<void> que contiene códigos de error específicos en caso de fallos:

Esta guía fue generada por una IA sobre la base de la especificación AUTOSAR R25-11.

Mapa de miembros

Diagrama de clases

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__per__WriteAccessor940 WriteAccessor + WriteAccessor() + ~WriteAccessor() + SetFileSize() + SyncToFile() + WriteBinary() + WriteText() + operator<<() nara__per__FileAccessor932 FileAccessor nara__per__WriteAccessor940->nara__per__FileAccessor932 nara__per__ReadWriteAccessor483 ReadWriteAccessor nara__per__ReadWriteAccessor483->nara__per__WriteAccessor940

Vista de detalle

Selecciona una entrada en el índice.

Constructores y destructor

WriteAccessor función

The default constructor for WriteAccessor shall not be used.

WriteAccessor ()=delete;

Destructor for WriteAccessor.

~WriteAccessor () override noexcept;

Métodos

SetFileSize función

Reduces the size of the file to ’size’, effectively removing the current content of the file beyond this size. The current file position is unchanged if it is lower than ’size’, or set to the last valid position in the file otherwise. If ’size’ is 0, the current file position will also be set to 0.

ara::core::Result< void > SetFileSize (std::uint64_t size) noexcept;
SyncToFile función

Flushes the current file content to the physical storage.

ara::core::Result< void > SyncToFile () noexcept;
WriteBinary función

Writes the content of a Span of Byte to the file. The time when the content is persisted depends on the implementation of Persistency. SyncTo File can be used to force Persistency to persist the file content. In case of an error, the file content might be corrupted, and the current position might or might not have changed. The expected state of the file for each supported error can be expected to be as follows: • kPhysicalStorageFailure: The state of the file is unknown. It could have been entirely destroyed. • kEncryptionFailed: The content of the file and the current position will have been updated, but could not be persisted. The persisted file will reflect an older version of the file. • kOutOfStorageSpace: The content of the file will have been updated, but the part of the operation that exceeded the quota will have been discarded. The current position will be at the end of the file.

ara::core::Result< void > WriteBinary (ara::core::Span< const ara::core::Byte > b) noexcept;
WriteText función

Writes the content of a StringView to the file. The time when the content is persisted depends on the implementation of Persistency. SyncTo File can be used to force Persistency to persist the file content. In case of an error, the file content might be corrupted, and the current position might or might not have changed. The expected state of the file for each supported error can be expected to be as follows: • kPhysicalStorageFailure: The state of the file is unknown. It could have been entirely destroyed. • kEncryptionFailed: The content of the file and the current position will have been updated, but could not be persisted. The persisted file will reflect an older version of the file. • kOutOfStorageSpace: The content of the file will have been updated, but the part of the operation that exceeded the quota will have been discarded. The current position will be at the end of the file.

ara::core::Result< void > WriteText (ara::core::StringView s) noexcept;

Operadores

operator<< función

Writes the content of a StringView to the file. This operator is just a comfort feature for non-safety critical Persistency users. If an error occurs during this operation, it is silently ignored.

WriteAccessor & operator<< (ara::core::StringView s) noexcept;

Documentación de los métodos

función SetFileSize [SWS_PER_00428] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00128, RS_AP_00127, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > SetFileSize (std::uint64_t size) noexcept;

Reduces the size of the file to ’size’, effectively removing the current content of the file beyond this size. The current file position is unchanged if it is lower than ’size’, or set to the last valid position in the file otherwise. If ’size’ is 0, the current file position will also be set to 0.

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe PerErrc::kPhysical no_rollback_semantics

Parameter (in)

ParameterBeschreibung
sizeNew size of the file.

Rückgabewert

TypBeschreibung
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

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kInvalidSizerollback_semantics Returned if the new size is larger than the current size.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or 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_00428
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00428@rel:R25-11#b1abadb9
Content hash
b1abadb9
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00428
Status: valid/unmigrated Version: rel:R25-11#ec5f6be0 Versionshistorie & Revisions (1 transition, 7 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_00428@rel:R25-11#ec5f6be0
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d8a624272026-09-30
  • R20-11rel:R20-11#695302e62026-10-14
  • R21-11rel:R21-11#aae1c4ab2026-10-14
  • R22-11rel:R22-11#3b63355b2026-10-14
  • R23-11rel:R23-11#4766ec6f2026-10-14
  • R24-11rel:R24-11#e7961eae2026-10-14
  • R25-11rel:R25-11#ec5f6be02026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función SyncToFile [SWS_PER_00122] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00128, RS_AP_00127, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > SyncToFile () noexcept;

Flushes the current file content to the physical storage.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: c625990570f3 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

La función miembro SyncToFile de la clase ara::per::WriteAccessor (definida en #include "ara/per/write_accessor.h") transfiere el contenido actual del archivo de forma síncrona al almacenamiento físico [SWS_PER_00122]. La llamada no acepta parámetros de entrada y devuelve un ara::core::Result<void> que, en caso de éxito, está vacío o, en caso de error, contiene códigos de error específicos del módulo Persistency o errores específicos del fabricante [SWS_PER_00122].

Durante la ejecución pueden producirse diferentes casos de error, algunos de los cuales poseen semántica de reversión (rollback) [SWS_PER_00122]:

  • StorageFailure: se produce cuando falla el acceso físico al medio de almacenamiento (sin semántica de reversión) [SWS_PER_00122].
  • PerErrc::kOutOfStorageSpace: se devuelve si el espacio de almacenamiento físico es insuficiente para el archivo modificado (sin semántica de reversión) [SWS_PER_00122].
  • PerErrc::kQuotaExceeded: se notifica cuando el archivo excede el tamaño máximo configurado AllowedSize del File Storage (con semántica de reversión) [SWS_PER_00122].
  • PerErrc::kEncryptionFailed: falla el cifrado de los datos almacenados (con semántica de reversión) [SWS_PER_00122].
  • PerErrc::kAuthenticationFailed: falla el cálculo del MAC para los datos (con semántica de reversión) [SWS_PER_00122].

En cuanto a la seguridad de ejecución, el método está declarado como noexcept y especificado como exception safe [SWS_PER_00122]. Sin embargo, dado que está clasificado expresamente como not thread-safe, las llamadas simultáneas sobre la misma instancia de WriteAccessor deben sincronizarse presumiblemente por parte del llamador [SWS_PER_00122]. Pregunta Q-e4b139f136cdcd31 (abierta)

Esta nota de uso se generó automáticamente a partir de la especificación AUTOSAR R25-11.

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe PerErrc::kPhysical no_rollback_semantics

Rückgabewert

TypBeschreibung
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

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption of stored data fails.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for the changed file.
PerErrc::kQuotaExceededrollback_semantics Returned if the changed file would exceed the configured maximum AllowedSize of the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating 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_00122
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00122@rel:R25-11#031ae210
Content hash
031ae210
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00122
Status: valid/unmigrated Version: rel:R25-11#3cd97c20 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_00122@rel:R25-11#3cd97c20
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#34b017482026-09-30
  • R19-11rel:R19-11#eb696f922026-10-14
  • R20-11rel:R20-11#a1c7cb002026-10-14
  • R21-11rel:R21-11#02cbbcfc2026-10-14
  • R22-11rel:R22-11#e11db5d22026-10-14
  • R23-11rel:R23-11#90ba1ab02026-10-14
  • R24-11rel:R24-11#3320747f2026-10-14
  • R25-11rel:R25-11#3cd97c202026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función WriteAccessor [SWS_PER_00596] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00129, RS_AP_00146

WriteAccessor ()=delete;

The default constructor for WriteAccessor shall not be used.

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00596
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00596@rel:R25-11#383cb2f4
Content hash
383cb2f4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00596
Status: valid/unmigrated Version: rel:R25-11#e4de44c4 Versionshistorie & Revisions (1 transition)
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_00596@rel:R25-11#e4de44c4
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función WriteBinary [SWS_PER_00423] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00121, RS_AP_00127, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > WriteBinary (ara::core::Span< const ara::core::Byte > b) noexcept;

Writes the content of a Span of Byte to the file. The time when the content is persisted depends on the implementation of Persistency. SyncTo File can be used to force Persistency to persist the file content. In case of an error, the file content might be corrupted, and the current position might or might not have changed. The expected state of the file for each supported error can be expected to be as follows: • kPhysicalStorageFailure: The state of the file is unknown. It could have been entirely destroyed. • kEncryptionFailed: The content of the file and the current position will have been updated, but could not be persisted. The persisted file will reflect an older version of the file. • kOutOfStorageSpace: The content of the file will have been updated, but the part of the operation that exceeded the quota will have been discarded. The current position will be at the end of the file.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 65db1acb87c9 Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

La función WriteBinary de la clase ara::per::WriteAccessor escribe el contenido de una secuencia de bytes (ara::core::Span<const ara::core::Byte>) en un archivo [SWS_PER_00423]. El momento de la persistencia efectiva en el medio de almacenamiento depende de la implementación de Persistency; mediante SyncToFile se puede forzar la persistencia síncrona [SWS_PER_00423]. La función está declarada como noexcept y se considera segura frente a excepciones [SWS_PER_00423].

En relación con la concurrencia, WriteBinary está especificada como no segura para subprocesos (not thread-safe) [SWS_PER_00423]. Los accesos paralelos al mismo descriptor de acceso deben sincronizarse en el nivel de aplicación.

En caso de error, se devuelve un código de error en ara::core::Result<void>, en el que el contenido del archivo puede quedar dañado y la posición actual puede haber cambiado [SWS_PER_00423]:

  • PerErrc::kPhysicalStorageFailure: El estado del archivo es desconocido y puede estar completamente destruido (sin semántica de reversión) [SWS_PER_00423].
  • PerErrc::kOutOfStorageSpace: Almacenamiento físico insuficiente; los datos que exceden la cuota se descartan y la posición del archivo se sitúa al final [SWS_PER_00423].
  • PerErrc::kQuotaExceeded: La operación de escritura superaría el tamaño máximo configurado AllowedSize [SWS_PER_00423].
  • PerErrc::kEncryptionFailed: El cifrado falla; el contenido y la posición del archivo se actualizan, pero no se persisten (el archivo persistido conserva la versión anterior) [SWS_PER_00423].
  • PerErrc::kAuthenticationFailed o PerErrc::kValidationFailed: El cálculo/verificación de MAC falla o no se garantiza la validez de los datos almacenados [SWS_PER_00423].

Esta nota de uso se ha generado automáticamente a partir del elemento de especificación [SWS_PER_00423].

Guía del implementador pendiente (complejidad I1)

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe PerErrc::kPhysical no_rollback_semantics

Parameter (in)

ParameterBeschreibung
bA Span of Byte containing the bytes to be written.

Rückgabewert

TypBeschreibung
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

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for the changed file.
PerErrc::kQuotaExceededrollback_semantics Returned if the changed file would exceed the configured maximum AllowedSize of the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or 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_00423
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00423@rel:R25-11#2636daa2
Content hash
2636daa2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00423
Status: valid/unmigrated Version: rel:R25-11#6fdad6e9 Versionshistorie & Revisions (1 transition, 7 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_00423@rel:R25-11#6fdad6e9
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#998ae4662026-09-30
  • R20-11rel:R20-11#e69bb1c32026-10-14
  • R21-11rel:R21-11#cbf9c5262026-10-14
  • R22-11rel:R22-11#1ed9b43a2026-10-14
  • R23-11rel:R23-11#a70520942026-10-14
  • R24-11rel:R24-11#7f59ce5a2026-10-14
  • R25-11rel:R25-11#6fdad6e92026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función WriteText [SWS_PER_00166] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00121, RS_AP_00127, RS_AP_00135, RS_AP_00136, RS_AP_00139, RS_AP_00159

ara::core::Result< void > WriteText (ara::core::StringView s) noexcept;

Writes the content of a StringView to the file. The time when the content is persisted depends on the implementation of Persistency. SyncTo File can be used to force Persistency to persist the file content. In case of an error, the file content might be corrupted, and the current position might or might not have changed. The expected state of the file for each supported error can be expected to be as follows: • kPhysicalStorageFailure: The state of the file is unknown. It could have been entirely destroyed. • kEncryptionFailed: The content of the file and the current position will have been updated, but could not be persisted. The persisted file will reflect an older version of the file. • kOutOfStorageSpace: The content of the file will have been updated, but the part of the operation that exceeded the quota will have been discarded. The current position will be at the end of the file.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: f24ce7c436f3 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

usar

El método síncrono WriteText de la interfaz ara::per::WriteAccessor escribe el contenido de un ara::core::StringView en el archivo abierto [SWS_PER_00166]. La función está especificada como segura frente a excepciones (exception safe) y declara no lanzar excepciones de C++ (noexcept) [SWS_PER_00166]. El momento exacto del almacenamiento físico depende de la implementación de Persistency; se puede forzar un guardado inmediato en el medio de almacenamiento mediante SyncToFile [SWS_PER_00166].

Manejo de errores

Como valor de retorno sirve un ara::core::Result<void> que, en caso de error, notifica códigos de error procedentes de PerErrc o errores específicos del fabricante [SWS_PER_00166]. Si la operación falla, el contenido del archivo puede quedar dañado y la posición de escritura puede haberse modificado [SWS_PER_00166]:

  • PerErrc::kPhysicalStorageFailure: acceso al almacenamiento físico fallido; el estado del archivo es desconocido o el archivo está destruido [SWS_PER_00166].
  • PerErrc::kEncryptionFailed: el cifrado falla; el contenido del archivo y la posición en memoria se actualizan, pero no pueden persistirse, por lo que permanece un estado persistido anterior [SWS_PER_00166].
  • PerErrc::kOutOfStorageSpace: espacio de almacenamiento físico insuficiente; los datos que exceden la cuota se descartan y la posición queda al final del archivo [SWS_PER_00166].
  • PerErrc::kQuotaExceeded, PerErrc::kValidationFailed y PerErrc::kAuthenticationFailed: notifican excesos de cuota (AllowedSize), así como errores de validación o autenticación, manteniendo la semántica de reversión [SWS_PER_00166].

Concurrencia y restricciones

La operación está catalogada como no segura para subprocesos (not thread-safe) [SWS_PER_00166]. En caso de accesos paralelos a la misma instancia de WriteAccessor, presumiblemente los llamadores deben sincronizar las llamadas por sí mismos. Pregunta Q-73a6dbdb7d3df643 (abierta)

Esta nota de uso se basa en la especificación AUTOSAR Adaptive Platform R25-11.

Guía del implementador pendiente (complejidad I1)

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe PerErrc::kPhysical no_rollback_semantics

Parameter (in)

ParameterBeschreibung
sA StringView containing the characters to be written.

Rückgabewert

TypBeschreibung
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

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for the changed file.
PerErrc::kQuotaExceededrollback_semantics Returned if the changed file would exceed the configured maximum AllowedSize of the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or 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_00166
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00166@rel:R25-11#1ab3e310
Content hash
1ab3e310
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00166
Status: valid/unmigrated Version: rel:R25-11#4e3c0698 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_00166@rel:R25-11#4e3c0698
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#d1e8d7c42026-09-30
  • R19-11rel:R19-11#b4195f8c2026-10-14
  • R20-11rel:R20-11#c28d17da2026-10-14
  • R21-11rel:R21-11#18edcb3e2026-10-14
  • R22-11rel:R22-11#c7bb41a02026-10-14
  • R23-11rel:R23-11#e3cd60ee2026-10-14
  • R24-11rel:R24-11#604776402026-10-14
  • R25-11rel:R25-11#4e3c06982026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función operator<< [SWS_PER_00125] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00121, RS_AP_00127, RS_AP_00159

WriteAccessor & operator<< (ara::core::StringView s) noexcept;

Writes the content of a StringView to the file. This operator is just a comfort feature for non-safety critical Persistency users. If an error occurs during this operation, it is silently ignored.

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Parameter (in)

ParameterBeschreibung
sThe StringView containing the characters to be written.

Rückgabewert

TypBeschreibung
WriteAccessor &The WriteAccessor object.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00125
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00125@rel:R25-11#d8f531b7
Content hash
d8f531b7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00125
Status: valid/unmigrated Version: rel:R25-11#916de40e 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_00125@rel:R25-11#916de40e
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#8b2877cf2026-09-30
  • R19-11rel:R19-11#400a0ec52026-10-14
  • R20-11rel:R20-11#fe7ae1572026-10-14
  • R21-11rel:R21-11#fe7ae1572026-10-14
  • R22-11rel:R22-11#7a940c0b2026-10-14
  • R23-11rel:R23-11#01a269a42026-10-14
  • R24-11rel:R24-11#d4351b602026-10-14
  • R25-11rel:R25-11#916de40e2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

función ~WriteAccessor [SWS_PER_00597] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00129, RS_AP_00134, RS_AP_00145, RS_AP_00159

~WriteAccessor () override noexcept;

Destructor for WriteAccessor.

Header-Datei#include "ara/per/write_accessor.h"
Scopeclass ara::per::WriteAccessor
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00597
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00597@rel:R25-11#236a6f1d
Content hash
236a6f1d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00597
Status: valid/unmigrated Version: rel:R25-11#0c1fc20b Versionshistorie & Revisions (1 transition)
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_00597@rel:R25-11#0c1fc20b
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill