DEENESPTFRRUARHIKOZHNL

클래스 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

사용자 가이드AI 생성

바이너리 및 텍스트 파일의 버퍼링된 쓰기와 물리적 스토리지로의 동기화를 위해 사용됩니다.
AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: fd57dd10b948 출처 열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

바이너리 및 텍스트 파일의 버퍼링된 쓰기와 물리적 스토리지로의 동기화를 위해 사용됩니다.

클래스 ara::per::WriteAccessor은 지속성 모듈에서 바이너리 또는 텍스트 파일 콘텐츠의 작성을 지원하며 비포맷 쓰기 접근을 위한 메서드 및 포맷된 스트림 연산자를 제공합니다 [SWS_PER_00423]. 쓰기 작업은 처음에 운영체제에 의해 버퍼링될 수 있으므로, SyncToFile() 호출을 통해 물리적 스토리지로의 영구적인 플러시를 강제합니다 [SWS_PER_00122]. 모든 메서드는 예외 안전하지만 스레드 안전하지 않으므로, 애플리케이션에서 동시 접근을 보호해야 합니다.

컨텍스트

ara::per::WriteAccessor은 AUTOSAR Adaptive Platform 지속성 모듈(per)의 최종(final) 클래스이며 FileAccessor에서 가상으로 상속받습니다. 이 클래스는 파일 콘텐츠에 대한 쓰기 작업을 제공합니다. ara::core::Result을 통한 오류 처리와 함께 비포맷 제어 쓰기를 위한 메서드 및 포맷된 쓰기를 위한 오버로드된 스트림 연산자를 제공합니다. 상호작용 주체로는 호출 애플리케이션, 운영체제의 내부 파일 버퍼 및 물리적 스토리지 매체가 있습니다.

수명 주기

WriteAccessor의 기본 생성자는 명시적으로 삭제되었으며 사용할 수 없습니다 [SWS_PER_00596]. (해석: WriteAccessor의 인스턴스는 파일 스토리지와 같은 상위 지속성 관리 유닛의 팩토리 메서드를 통해 생성 및 제공될 것으로 보입니다.) 질문 Q-af92be8494274611 (열림)

소멸은 가상 소멸자 ~WriteAccessor()을 통해 수행됩니다 [SWS_PER_00597]. 클래스 및 해당 메서드는 예외 안전(“exception safe”)으로 명시되어 있으며 noexcept(으)로 선언되어 있습니다. 동시성과 관련하여 WriteAccessor은 스레드 안전하지 않습니다(“not thread-safe”) [SWS_PER_00597]. 동일 인스턴스에 대한 병렬 접근은 애플리케이션에서 외부적으로 보호해야 합니다.

사용 경로

일반적인 흐름에는 비포맷 또는 포맷 모드로 데이터 쓰기, 선택적 파일 크기 조정 및 최종 영구 저장이 포함됩니다:

  • 바이너리 데이터 쓰기: WriteBinary()을 통해 바이트 범위(ara::core::Span<const ara::core::Byte>)가 파일에 기록됩니다 [SWS_PER_00423].
  • 텍스트 데이터 쓰기: WriteText()을 사용하여 ara::core::StringView을 통해 문자열이 전달됩니다 [SWS_PER_00166]. 추가로 중요하지 않은 사용 사례를 위한 편의 기능으로 operator<<이 제공되며, 발생하는 오류는 조용히 무시됩니다 [SWS_PER_00125].
  • 지속성 강제: 물리적 스토리지로의 저장 시점은 지속성 구현에 따라 달라집니다. SyncToFile()은 운영체제의 버퍼를 스토리지 매체로 확정적으로 플러시합니다 [SWS_PER_00122], [SWS_PER_00423], [SWS_PER_00166].
  • 파일 크기 조정: SetFileSize()을 사용하여 파일을 자를 수 있으며, 이를 통해 초과된 콘텐츠가 제거됩니다. 파일 위치는 변경되지 않거나 마지막 유효 위치 또는 0으로 설정됩니다 [SWS_PER_00428].
파일 콘텐츠 작성 및 동기화 시 일반적인 흐름애플리케이션WriteAccessorSpeichermediumWriteBinary(b) / WriteText(s)ara::core::Result<void>SyncToFile()Betriebssystem-Puffer flashen상태 / 확인ara::core::Result<void>

시퀀스 다이어그램: 물리적 스토리지로의 후속 동기화가 포함된 쓰기 작업. 출처: [SWS_PER_00423], [SWS_PER_00166], [SWS_PER_00122]

오류 시나리오

메서드 WriteBinary(), WriteText(), SyncToFile() 및 SetFileSize()은 실패 시 특정 오류 코드를 포함하는 ara::core::Result<void>을(를) 반환합니다:

이 가이드는 AUTOSAR 사양 R25-11을 기반으로 AI에 의해 생성되었습니다.

멤버 맵

클래스 다이어그램

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

상세 보기

개요에서 항목을 선택하세요.

생성자 및 소멸자

The default constructor for WriteAccessor shall not be used.

WriteAccessor ()=delete;

Destructor for WriteAccessor.

~WriteAccessor () override 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.

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

Flushes the current file content to the physical storage.

ara::core::Result< void > SyncToFile () 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.

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

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;

연산자

operator<< 함수

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;

메서드 문서

함수 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#e5fda7ab
Content hash
e5fda7ab
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

함수 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.

AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: c625990570f3 출처 열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

ara::per::WriteAccessor 클래스의 멤버 함수 SyncToFile(#include "ara/per/write_accessor.h"에 정의됨)은 현재 파일 내용을 물리적 스토리지로 동기식으로 전송합니다 [SWS_PER_00122]. 이 호출은 전달 매개변수를 받지 않으며, 성공 시 비어 있거나 오류 시 Persistency 모듈의 특정 오류 코드 또는 제조사별 오류를 포함하는 ara::core::Result<void>을(를) 반환합니다 [SWS_PER_00122].

수행 시 다양한 오류 사례가 발생할 수 있으며, 이들 중 일부는 롤백 시맨틱을 갖습니다 [SWS_PER_00122]:

  • StorageFailure: 저장 매체에 대한 물리적 접근이 실패할 때 발생합니다(롤백 시맨틱 없음) [SWS_PER_00122].
  • PerErrc::kOutOfStorageSpace: 수정된 파일에 대한 물리적 스토리지 공간이 부족한 경우 반환됩니다(롤백 시맨틱 없음) [SWS_PER_00122].
  • PerErrc::kQuotaExceeded: 파일이 File Storage의 구성된 최대 크기 AllowedSize을(를) 초과할 때 보고됩니다(롤백 시맨틱 적용) [SWS_PER_00122].
  • PerErrc::kEncryptionFailed: 저장된 데이터의 암호화에 실패할 때(롤백 시맨틱 적용) [SWS_PER_00122].
  • PerErrc::kAuthenticationFailed: 데이터에 대한 MAC 계산이 실패할 때(롤백 시맨틱 적용) [SWS_PER_00122].

실행 안전성과 관련하여 이 메서드는 noexcept(으)로 선언되어 있으며 exception safe(으)로 명시되어 있습니다 [SWS_PER_00122]. 그러나 명시적으로 not thread-safe(으)로 분류되어 있으므로 동일한 WriteAccessor 인스턴스에 대한 동시 호출은 호출자에 의해 동기화되어야 할 것으로 보입니다 [SWS_PER_00122]. 질문 Q-e4b139f136cdcd31 (열림)

이 사용 지침은 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#2b1230e0
Content hash
2b1230e0
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

함수 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#ff5355d9
Content hash
ff5355d9
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

함수 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.

AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: 65db1acb87c9 출처
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

"ara::per::WriteAccessor 클래스의 WriteBinary 함수는 바이트 시퀀스(ara::core::Span<const ara::core::Byte>)의 내용을 파일에 씁니다 [SWS_PER_00423]. 스토리지 매체에 실제로 영속화되는 시점은 Persistency 구현에 따라 달라지며, SyncToFile을(를) 통해 동기 영속화를 강제할 수 있습니다 [SWS_PER_00423]. 이 함수는 noexcept(으)로 선언되어 있으며 예외 안전한 것으로 간주됩니다 [SWS_PER_00423]."

"동시성 측면에서 WriteBinary은(는) 스레드 안전하지 않은 것(not thread-safe)으로 명시되어 있습니다 [SWS_PER_00423]. 동일한 접근자(Accessor)에 대한 병렬 접근은 애플리케이션 수준에서 동기화되어야 합니다."

"오류가 발생하는 경우 ara::core::Result<void>의 오류 코드가 반환되며, 이때 파일 내용이 손상되거나 현재 위치가 변경되었을 수 있습니다 [SWS_PER_00423]:"

  • "PerErrc::kPhysicalStorageFailure: 파일의 상태를 알 수 없으며 완전히 파괴되었을 수 있습니다(롤백 시맨틱 없음) [SWS_PER_00423]."
  • "PerErrc::kOutOfStorageSpace: 물리적 스토리지가 부족합니다. 할당량을 초과하는 데이터는 폐기되며 파일 위치는 끝에 위치합니다 [SWS_PER_00423]."
  • "PerErrc::kQuotaExceeded: 쓰기 작업이 구성된 최대 크기 AllowedSize을(를) 초과합니다 [SWS_PER_00423]."
  • "PerErrc::kEncryptionFailed: 암호화에 실패했습니다. 파일 내용과 위치는 업데이트되지만 영속화되지는 않습니다(영속화된 파일은 이전 버전을 유지함) [SWS_PER_00423]."
  • "PerErrc::kAuthenticationFailed 또는 PerErrc::kValidationFailed: MAC 계산/검증에 실패했거나 저장된 데이터의 유효성이 보장되지 않습니다 [SWS_PER_00423]."

"이 사용 지침은 사양 요소 [SWS_PER_00423]을(를) 바탕으로 자동 생성되었습니다."

구현자 가이드 준비 중 (복잡도 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#a8d217f5
Content hash
a8d217f5
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

함수 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.

AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: f24ce7c436f3 출처 열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

사용

ara::per::WriteAccessor 인터페이스의 동기식 메서드 WriteText은(는) ara::core::StringView의 내용을 열려 있는 파일에 기록합니다 [SWS_PER_00166]. 이 함수는 예외 안전(exception safe)(으)로 명시되어 있으며 C++ 예외를 발생시키지 않음(noexcept)(으)로 선언되어 있습니다 [SWS_PER_00166]. 물리적 스토리지 저장의 정확한 시점은 Persistency 구현에 따라 달라지며, 저장 매체로의 즉각적인 저장은 SyncToFile을(를) 통해 강제할 수 있습니다 [SWS_PER_00166].

오류 처리

반환값으로는 오류 발생 시 PerErrc의 오류 코드 또는 제조사별 오류를 보고하는 ara::core::Result<void>이(가) 사용됩니다 [SWS_PER_00166]. 작업이 실패하면 파일 내용이 손상되고 쓰기 위치가 변경될 수 있습니다 [SWS_PER_00166]:

  • PerErrc::kPhysicalStorageFailure: 물리적 스토리지 접근 실패; 파일 상태를 알 수 없거나 파일이 손상되었습니다 [SWS_PER_00166].
  • PerErrc::kEncryptionFailed: 암호화 실패; 메모리 내의 파일 내용과 위치는 업데이트되지만 영속화될 수 없으므로 이전에 영속화된 상태가 유지됩니다 [SWS_PER_00166].
  • PerErrc::kOutOfStorageSpace: 물리적 스토리지 공간 부족; 할당량을 초과하는 데이터는 폐기되며 위치는 파일 끝에 배치됩니다 [SWS_PER_00166].
  • PerErrc::kQuotaExceeded, PerErrc::kValidationFailed 및 PerErrc::kAuthenticationFailed: 롤백 시맨틱을 유지하면서 할당량 초과(AllowedSize) 및 유효성 검사 또는 인증 오류를 보고합니다 [SWS_PER_00166].

동시성 및 제약사항

이 작업은 스레드 안전하지 않음(not thread-safe)(으)로 분류되어 있습니다 [SWS_PER_00166]. 동일한 WriteAccessor 인스턴스에 병렬로 접근할 때 호출자는 호출을 독립적으로 동기화해야 할 것으로 보입니다. 질문 Q-73a6dbdb7d3df643 (열림)

이 사용 지침은 AUTOSAR Adaptive Platform R25-11 사양을 기반으로 합니다.

구현자 가이드 준비 중 (복잡도 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#4fcf9ca3
Content hash
4fcf9ca3
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

함수 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#49bb6fbc
Content hash
49bb6fbc
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

함수 ~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#e930c6dc
Content hash
e930c6dc
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