DEENESPTFRRUARHIKOZHNL

klasse 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

User GuideAI-GEGENEREERD

Dient voor het gebufferd schrijven van binaire en tekstbestanden en de synchronisatie daarvan naar het fysieke geheugen.
DOOR AI GEGENEREERD ongecontroleerd Model: gemini-3.8-flash-medium · Inspanning: medium · Temperatuur: niet regelbaar · Prompt: fd57dd10b948 Herkomst Open vragen (1)
vertaald uit de Duitse handleidinggemini-3.8-flash-low · 2026-10-13 · Duits origineel

Dient voor het gebufferd schrijven van binaire en tekstbestanden en de synchronisatie daarvan naar het fysieke geheugen.

De klasse ara::per::WriteAccessor maakt het schrijven van binaire of tekstuele bestandsinhoud in de persistoriemodule mogelijk en stelt methoden voor ongeformatteerde schrijftoegangen evenals een geformatteerde stream-operator ter beschikking [SWS_PER_00423]. Omdat schrijfacties eerst in het besturingssysteem kunnen worden gebufferd, dwingt de aanroep van SyncToFile() het permanent flashen naar het fysieke geheugen af [SWS_PER_00122]. Alle methoden zijn exception-safe, maar niet thread-safe, waardoor gelijktijdige toegangen door de applicatie moeten worden beschermd.

Context

ara::per::WriteAccessor is een finale klasse van de persistoriemodule (per) van het AUTOSAR Adaptive Platform en leidt virtueel af van FileAccessor. De klasse stelt schrijfbewerkingen voor bestandsinhoud ter beschikking. Zij biedt methoden voor ongeformatteerd, gecontroleerd schrijven met foutafhandeling via ara::core::Result evenals een overbeladen stream-operator voor geformatteerd schrijven. Als interactiepartners fungeren de aanroepende applicatie, de interne bestandsbuffer van het besturingssysteem en het fysieke opslagmedium.

Levenscyclus

De standaardconstructor van WriteAccessor is expliciet verwijderd en mag niet worden gebruikt [SWS_PER_00596]. (Interpretatie: instanties van WriteAccessor worden vermoedelijk aangemaakt en ter beschikking gesteld via factory-methoden van bovenliggende persistentiebeheereenheden zoals file-storage.) Vraag Q-af92be8494274611 (open)

De vernietiging vindt plaats via de virtuele destructor ~WriteAccessor() [SWS_PER_00597]. De klasse en haar methoden zijn gespecificeerd als exception-safe (“exception safe”) en gedeclareerd als noexcept. Met betrekking tot gelijktijdigheid is WriteAccessor niet thread-safe (“not thread-safe”) [SWS_PER_00597]; parallelle toegangen tot dezelfde instantie moeten extern door de applicatie worden beveiligd.

Gebruikspad

Het reguliere verloop omvat het schrijven van gegevens in ongeformatteerde of geformatteerde modus, het optioneel aanpassen van de bestandsgrootte en de uiteindelijke persistente opslag:

  • Binaire gegevens schrijven: via WriteBinary() wordt een bytebereik (ara::core::Span<const ara::core::Byte>) naar het bestand geschreven [SWS_PER_00423].
  • Tekstgegevens schrijven: met behulp van WriteText() worden tekenreeksen via een ara::core::StringView doorgegeven [SWS_PER_00166]. Aanvullend is operator<< beschikbaar als gemakkelijke functie voor niet-kritische usecases, waarbij optredende fouten stilzwijgend worden genegeerd [SWS_PER_00125].
  • Persisteren afdwingen: het tijdstip van fysieke opslag hangt af van de persistentie-implementatie; SyncToFile() flasht de buffer van het besturingssysteem bindend naar het opslagmedium [SWS_PER_00122], [SWS_PER_00423], [SWS_PER_00166].
  • Bestandsgrootte aanpassen: met SetFileSize() kan het bestand worden ingekort, waardoor overtollige inhoud wordt verwijderd; de bestandspositie blijft ongewijzigd of wordt op de laatste geldige positie respectievelijk 0 gezet [SWS_PER_00428].
Typisch verloop bij het schrijven en synchroniseren van bestandsinhoudAnwendungWriteAccessorSpeichermediumWriteBinary(b) / WriteText(s)ara::core::Result<void>SyncToFile()Betriebssystem-Puffer flashenStatus / bevestigingara::core::Result<void>

Sequentiediagram: schrijfbewerkingen met aansluitende synchronisatie naar het fysieke geheugen. Bronnen: [SWS_PER_00423], [SWS_PER_00166], [SWS_PER_00122]

Foutscenario's

De methoden WriteBinary(), WriteText(), SyncToFile() en SetFileSize() retourneren een ara::core::Result<void> die bij mislukkingen specifieke foutcodes bevat:

Deze handleiding is gegenereerd door een AI op basis van de AUTOSAR-specificatie R25-11.

Ledenkaart

Klassendiagram

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

Detailweergave

Kies een item in de inhoudsopgave.

Constructors en destructor

The default constructor for WriteAccessor shall not be used.

WriteAccessor ()=delete;

Destructor for WriteAccessor.

~WriteAccessor () override noexcept;

Methoden

SetFileSize functie

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 functie

Flushes the current file content to the physical storage.

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

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 functie

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;

Operatoren

operator<< functie

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;

Documentatie van de methoden

functie 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#450ff56b
Content hash
450ff56b
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

functie 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.

DOOR AI GEGENEREERD ongecontroleerd Model: gemini-3.8-flash-medium · Inspanning: medium · Temperatuur: niet regelbaar · Prompt: c625990570f3 Herkomst Open vragen (1)
vertaald uit de Duitse handleidinggemini-3.8-flash-low · 2026-10-13 · Duits origineel

De lidfunctie SyncToFile van de klasse ara::per::WriteAccessor (gedefinieerd in #include "ara/per/write_accessor.h") schrijft de actuele bestandsinhoud synchroon naar het fysieke geheugen [SWS_PER_00122]. De aanroep accepteert geen invoerparameters en retourneert een ara::core::Result<void>, die in geval van succes leeg is of bij een fout specifieke foutcodes van de Persistency-module dan wel fabrikantspecifieke fouten bevat [SWS_PER_00122].

Bij de uitvoering kunnen verschillende foutsituaties optreden, die deels rollback-semantiek hebben [SWS_PER_00122]:

  • StorageFailure: Treedt op wanneer de fysieke toegang tot het opslagmedium mislukt (geen rollback-semantiek) [SWS_PER_00122].
  • PerErrc::kOutOfStorageSpace: Wordt geretourneerd indien de fysieke opslagruimte voor het gewijzigde bestand onvoldoende is (geen rollback-semantiek) [SWS_PER_00122].
  • PerErrc::kQuotaExceeded: Wordt gemeld wanneer het bestand de geconfigureerde maximale grootte AllowedSize van de File Storage overschrijdt (met rollback-semantiek) [SWS_PER_00122].
  • PerErrc::kEncryptionFailed: Indien de versleuteling van de opgeslagen gegevens mislukt (met rollback-semantiek) [SWS_PER_00122].
  • PerErrc::kAuthenticationFailed: Indien de berekening van de MAC voor de gegevens mislukt (met rollback-semantiek) [SWS_PER_00122].

Wat betreft de uitvoeringsveiligheid is de methode gedeclareerd als noexcept en gespecificeerd als exception safe [SWS_PER_00122]. Omdat deze echter uitdrukkelijk is geclassificeerd als not thread-safe, moeten gelijktijdige aanroepen op dezelfde WriteAccessor-instantie vermoedelijk door de aanroeper worden gesynchroniseerd [SWS_PER_00122]. Vraag Q-e4b139f136cdcd31 (open)

Deze gebruiksinstructie is geautomatiseerd gegenereerd op basis van de specificatie 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#f36d1598
Content hash
f36d1598
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

functie 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#21530484
Content hash
21530484
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

functie 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.

DOOR AI GEGENEREERD ongecontroleerd Model: gemini-3.8-flash-medium · Inspanning: medium · Temperatuur: niet regelbaar · Prompt: 65db1acb87c9 Herkomst
vertaald uit de Duitse handleidinggemini-3.8-flash-low · 2026-10-13 · Duits origineel

De functie WriteBinary van de klasse ara::per::WriteAccessor schrijft de inhoud van een bytesequentie (ara::core::Span<const ara::core::Byte>) naar een bestand [SWS_PER_00423]. Het tijdstip van de daadwerkelijke persistentie op het opslagmedium hangt af van de implementatie van Persistency; via SyncToFile kan het synchrone persisteren worden geforceerd [SWS_PER_00423]. De functie is gedeclareerd als noexcept en geldt als uitzonderingsveilig [SWS_PER_00423].

Met betrekking tot gelijktijdigheid is WriteBinary gespecificeerd als niet thread-safe (not thread-safe) [SWS_PER_00423]. Parallelle toegangen tot dezelfde accessor moeten op applicatieniveau worden gesynchroniseerd.

Bij een fout wordt een foutcode in ara::core::Result<void> geretourneerd, waarbij de bestandsinhoud beschadigd kan zijn en de huidige positie gewijzigd kan zijn [SWS_PER_00423]:

  • PerErrc::kPhysicalStorageFailure: Toestand van het bestand is onbekend en kan volledig vernietigd zijn (geen rollback-semantiek) [SWS_PER_00423].
  • PerErrc::kOutOfStorageSpace: Onvoldoende fysiek geheugen; gegevens die het quotum overschrijden worden verworpen en de bestandspositie staat aan het einde [SWS_PER_00423].
  • PerErrc::kQuotaExceeded: Het schrijfproces zou de geconfigureerde maximale omvang AllowedSize overschrijden [SWS_PER_00423].
  • PerErrc::kEncryptionFailed: Versleuteling mislukt; bestandsinhoud en positie worden bijgewerkt, maar niet gepersisteerd (gepersisteerd bestand behoudt de vorige versie) [SWS_PER_00423].
  • PerErrc::kAuthenticationFailed resp. PerErrc::kValidationFailed: MAC-berekening/-controle mislukt of de validiteit van opgeslagen gegevens is niet gewaarborgd [SWS_PER_00423].

Deze gebruiksinstructie is geautomatiseerd gegenereerd op basis van specificatie-element [SWS_PER_00423].

Implementer's Guide volgt (complexiteit 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#3ddc40f0
Content hash
3ddc40f0
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

functie 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.

DOOR AI GEGENEREERD ongecontroleerd Model: gemini-3.8-flash-medium · Inspanning: medium · Temperatuur: niet regelbaar · Prompt: f24ce7c436f3 Herkomst Open vragen (1)
vertaald uit de Duitse handleidinggemini-3.8-flash-low · 2026-10-13 · Duits origineel

Gebruik

De synchrone methode WriteText van de interface ara::per::WriteAccessor schrijft de inhoud van een ara::core::StringView naar het geopende bestand [SWS_PER_00166]. De functie is gespecificeerd als uitzonderingsveilig (exception safe) en declareert geen C++-exceptions te werpen (noexcept) [SWS_PER_00166]. Het exacte tijdstip van fysieke opslag hangt af van de Persistency-implementatie; een onmiddellijke opslag op het opslagmedium kan worden geforceerd via SyncToFile [SWS_PER_00166].

Foutafhandeling

Als retourwaarde dient een ara::core::Result<void>, die bij een fout foutcodes uit PerErrc of fabrikantspecifieke fouten meldt [SWS_PER_00166]. Mislukt de bewerking, dan kan de bestandsinhoud beschadigd zijn en kan de schrijfpositie gewijzigd zijn [SWS_PER_00166]:

  • PerErrc::kPhysicalStorageFailure: Fysieke geheugentoegang mislukt; de bestandstoestand is onbekend of het bestand is vernietigd [SWS_PER_00166].
  • PerErrc::kEncryptionFailed: Versleuteling mislukt; bestandsinhoud en positie in het geheugen worden bijgewerkt, maar kunnen niet worden gepersisteerd, waardoor een oudere gepersisteerde versie behouden blijft [SWS_PER_00166].
  • PerErrc::kOutOfStorageSpace: Onvoldoende fysieke opslagruimte; gegevens boven het quotum worden verworpen en de positie bevindt zich aan het bestandseinde [SWS_PER_00166].
  • PerErrc::kQuotaExceeded, PerErrc::kValidationFailed en PerErrc::kAuthenticationFailed: Melden quotumoverschrijdingen (AllowedSize) evenals validatie- of authenticatiefouten met behoud van rollback-semantiek [SWS_PER_00166].

Gelijktijdigheid en beperkingen

De bewerking is geclassificeerd als niet thread-safe (not thread-safe) [SWS_PER_00166]. Bij parallelle toegangen tot dezelfde instantie van WriteAccessor moeten aanroepers de aanroepen vermoedelijk zelfstandig synchroniseren. Vraag Q-73a6dbdb7d3df643 (open)

Deze gebruiksinstructie is gebaseerd op de specificatie AUTOSAR Adaptive Platform R25-11.

Implementer's Guide volgt (complexiteit 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#11cda5f2
Content hash
11cda5f2
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

functie 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#64ef5d80
Content hash
64ef5d80
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

functie ~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#4e659d2c
Content hash
4e659d2c
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