Permite o armazenamento e o gerenciamento persistentes de dados de aplicação por meio de armazenamento de chave-valor e de arquivos.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 9cb072b2740aProcedênciaPerguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
Permite o armazenamento e o gerenciamento persistentes de dados de aplicação por meio de armazenamento de chave-valor e de arquivos.
O namespace ara::per disponibiliza interfaces para o armazenamento persistente de dados, permitindo que aplicações adaptativas acessem áreas de armazenamento baseadas em arquivos e em chave-valor por meio de identificadores de instância ([SWS_PER_00052], [SWS_PER_00116]). As aplicações gerenciam armazenamentos abertos por meio de handles compartilhados, executam atualizações coordenadas em caso de alterações no manifesto e podem reparar dados inconsistentes por meio de mecanismos de recuperação ([SWS_PER_00333], [SWS_PER_00357]). Enquanto os acessos ao armazenamento ocorrem de forma simultânea via handles, operações administrativas como atualizações ou resets de armazenamento exigem a ausência de acessos concorrentes ([SWS_PER_00311]).
Contexto
O namespace ara::per disponibiliza as interfaces do grupo de funções de persistência para a AUTOSAR Adaptive Platform. Sua responsabilidade primária é o armazenamento durável de dados de aplicação, sobrevivendo à memória volátil através de inicializações do sistema e ciclos de vida de processos. O módulo distingue dois paradigmas básicos de armazenamento: KeyValueStorage para pares chave-valor estruturados e FileStorage para acesso a armazenamento baseado em arquivos. Aplicações adaptativas acessam esses recursos por meio de protótipos de porta configurados via ara::core::InstanceSpecifier ([SWS_PER_00052], [SWS_PER_00116]).
Parceiros de interação importantes do namespace são o Update and Configuration Management (UCM), que pode disponibilizar configurações de destino (Target Configuration) atualizadas durante o tempo de execução ([SWS_PER_00576], [SWS_PER_00577]), bem como o meio físico de armazenamento, no qual ara::per garante consistência, redundância e segurança de dados ([SWS_PER_00311]).
O acesso a objetos de armazenamento é controlado por meio de abstrações de handle. A abertura de um armazenamento via OpenKeyValueStorage ou OpenFileStorage cria um SharedHandle ([SWS_PER_00052], [SWS_PER_00116]). Como múltiplas threads podem acessar simultaneamente o mesmo armazenamento, o recurso físico não é necessariamente fechado quando um único SharedHandle sai de seu escopo; o fechamento só ocorre quando todas as instâncias de SharedHandle que o referenciam forem descartadas ([SWS_PER_00052], [SWS_PER_00116]).
Para arquivos dentro de um FileStorage, os estados de criação e modificação são rastreados detalhadamente. A enumeração FileCreationState mapeia se um arquivo foi criado na instalação (kCreatedDuringInstallation), durante uma atualização (kCreatedDuringUpdate), por um reset (kCreatedDuringReset), em decorrência de uma recuperação (kCreatedDuringRecovery) ou pela própria aplicação (kCreatedByApplication) ([SWS_PER_00435]). De forma análoga, FileModificationState reflete quando e por qual operação um arquivo foi modificado pela última vez ([SWS_PER_00436]).
Para o gerenciamento de estados iniciais, o namespace disponibiliza funções de reset: ResetKeyValueStorage ([SWS_PER_00334]) e ResetAllFiles ([SWS_PER_00336]) redefinem armazenamentos individuais para os valores inicialmente definidos no manifesto. Em contrapartida, a operação global ResetPersistency ([SWS_PER_00358]) esvazia completamente todos os armazenamentos de chave-valor e de arquivos; sua recriação ocorre na chamada seguinte de OpenFileStorage ou OpenKeyValueStorage.
Um fluxo típico de aplicação abrange a verificação de atualizações de configuração, a aplicação de migrações de dados e o subsequente acesso ao armazenamento:
Antes ou durante a operação normal, a aplicação verifica por meio de CheckForManifestUpdate se o UCM instalou uma nova configuração de destino ([SWS_PER_00576]). Se for o caso, o novo manifesto é lido via ReloadPersistencyManifest ([SWS_PER_00577]). Durante a fase de verificação subsequente, a aplicação dispara UpdatePersistency ([SWS_PER_00357]). Para controlar migrações de dados específicas de versão, a aplicação registra previamente via RegisterApplicationDataUpdateCallback uma função de callback, que é informada sobre versões de contrato anteriores e executa etapas de migração próprias da aplicação ([SWS_PER_00356]). Adicionalmente, alterações em elementos podem ser monitoradas por meio de RegisterDataUpdateIndication ([SWS_PER_00578]). Após a conclusão da atualização, CleanUpPersistency remove backups obsoletos e itens redundantes remanescentes ([SWS_PER_00567]).
Para o acesso regular, a aplicação abre o recurso de destino via OpenKeyValueStorage ([SWS_PER_00052]) ou OpenFileStorage ([SWS_PER_00116]). Os acessos a arquivos no FileStorage são controlados por máscaras de bits da enumeração OpenMode (por exemplo, kAtTheBeginning, kAtTheEnd, kTruncate, kAppend), combinadas por meio dos operadores operator| ([SWS_PER_00144]) e operator|= ([SWS_PER_00434]) ([SWS_PER_00147]). Os posicionamentos ocorrem de forma relativa a Origin (kBeginning, kCurrent, kEnd) ([SWS_PER_00146]). O tamanho de memória atualmente ocupado pode ser determinado em tempo de execução via GetCurrentKeyValueStorageSize ([SWS_PER_00405]) e GetCurrentFileStorageSize ([SWS_PER_00406]).
Os erros no namespace são sinalizados de forma padronizada por meio da enumeração PerErrc ([SWS_PER_00311]) em conjunto com PerErrorDomain ([SWS_PER_00352]) e MakeErrorCode ([SWS_PER_00351]). A classe declarada PerException deve servir como tipo de exceção C++ para ambientes nos quais os erros não são tratados via ara::core::Result, mas sim por meio de exceções (interpretação). Pergunta Q-263982a4a4dae284 (aberta)
Os cenários centrais de erro compreendem:
Erros de configuração e endereçamento: Se o InstanceSpecifier passado não corresponder a nenhuma interface de porta configurada no modelo, a abertura com PerErrc::kStorageNotFound falha ([SWS_PER_00052], [SWS_PER_00116], [SWS_PER_00311]). Acessos a arquivos inexistentes geram PerErrc::kFileNotFound ([SWS_PER_00311]).
Perda de integridade e recuperação: Em caso de danos estruturais (PerErrc::kIntegrityCorrupted) ou verificações de redundância com falha (PerErrc::kValidationFailed), ara::per viabiliza uma recuperação de melhor esforço (best-effort) via RecoverKeyValueStorage ([SWS_PER_00333]) ou RecoverAllFiles ([SWS_PER_00335]). Por meio de RegisterRecoveryReportCallback ([SWS_PER_00433]), aplicações relevantes para segurança podem registrar automaticamente medidas corretivas com base em RecoveryReportKind (por exemplo, kKeyValueStorageRecovered, kFileRecovered) ([SWS_PER_00432]).
Limites de armazenamento e erros físicos: Se cotas ou capacidades físicas forem ultrapassadas, PerErrc::kOutOfStorageSpace, PerErrc::kQuotaExceeded ou PerErrc::kTooManyFiles são reportados ([SWS_PER_00311]). Erros de hardware ou de sistema de arquivos resultam em PerErrc::kPhysicalStorageFailure ([SWS_PER_00311]).
Segurança e modos de acesso: Se verificações ou cálculos criptográficos falharem, o módulo retorna PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed ([SWS_PER_00311]). Tentativas de escrita em áreas de armazenamento somente leitura são rejeitadas com PerErrc::kIllegalWriteAccess ([SWS_PER_00311]).
Este guia baseia-se exclusivamente na especificação da AUTOSAR Adaptive R25-11.
KI-gestützte Gruppierung auf Basis der Records und Spezifikationsauszüge; keine Gliederung aus der AUTOSAR-Spezifikation.
Diagrama de classes
Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.
Returns the space in bytes currently occupied by a File Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the File Storage is not opened and no other operation on the File Storage takes place at the same time.
Returns the space in bytes currently occupied by a Key-Value Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the Key-Value Storage is not opened and no other operation on the Key-Value Storage takes place at the same time.
Opens a File Storage. OpenFileStorage will fail with kResourceBusy when the File Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. Because multiple threads can access the same File Storage concurrently, the File Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same File Storage went out of scope.
Opens a Key-Value Storage. OpenKeyValueStorage will fail with kResourceBusy when the Key-Value Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. Because multiple threads can access the same Key-Value Storage concurrently, the Key-Value Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same Key-Value Storage went out of scope.
Defines the errors for Persistency. The enumeration values 0 - 255 are reserved for AUTOSAR assigned errors, the stack provider is free to define additional errors starting from 256.
Recovers a File Storage, including all files. RecoverAllFiles recovers a File Storage when the redundancy checks fail. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. This method does a best-effort recovery of all files. After recovery, files might show outdated or initial content, or might be lost.
Recovers a Key-ValueStorage. RecoverKeyValueStorage allows to recover a Key-Value Storage when the redundancy checks fail. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. This method does a best-effort recovery of all key-value pairs. After recovery, keys might show outdated or initial value, or might be lost.
Register a recovery reporting callback with Persistency. This callback can be used in safety-aware Adaptive Applications to detect actions of the Persistency that are related to the correctness of the persisted data and the reliability of the storage.
Checks for updates of the Persistency Target Configuration. This method can be used to detect configuration updates that are installed by UCM while the Adaptive Application that uses Persistency is running. To re-read the updated Target Configuration, the Adaptive Application needs to call ara::per:: ReloadPersistencyManifest.
Registers an application data update callback with Persistency. The provided callback function will be called by Persistency if an update of stored application data might be necessary. This decision is based on the contract versions. The contract version that last accessed Persistency is provided as an argument to the callback, as well as the ara::core::InstanceSpecifier referring to the updated Key- Value Storage or File Storage. Based on this information, the Adaptive Application can decide which updates are actually necessary, e.g. a migration from any older contract version could be supported, with different steps required for each of these. The provided function will be called from the context of ara::per::UpdatePersistency, ara::per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
Registers a data update indication callback with Persistency. The provided callback function will be called by Persistency when an update of stored data happened. It will be called from the context of ara::per::UpdatePersistency, ara:: per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
Re-reads the Target Configuration. This method can be used to prepare for updates of the Key-Value Storages and File Storages of Persistency after a new Target Configuration was installed by UCM while the Adaptive Application that uses Persistency is running. Storages are only updated after closing them, either when they are opened again or by an explicit call to ara:: per::UpdatePersistency.
Resets a File Storage, including all files. ResetAllFiles resets a File Storage to the initial state, containing only the files which were deployed from the Target Configuration, with their initial content. Afterwards, the File Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles.
Resets a Key-Value Storage to the initial state. ResetKeyValueStorage allows to reset a Key-Value Storage to the initial state, containing only key-value pairs which were deployed from the Target Configuration, with their initial values. Afterwards, the Key-Value Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage.
Resets all Key-Value Storages and File Storages by entirely removing their content. The Key-Value Storages and File Storages will be re-created when ara::per:: OpenFileStorage or ara::per::OpenKeyValueStorage is called next time.
Updates all Persistency Key-Value Storages and File Storages after a new Target Configuration was installed. This method can be used to update the persistent data of the Adaptive Application during verification phase.
Defines the errors for Persistency. The enumeration values 0 - 255 are reserved for AUTOSAR assigned errors, the stack provider is free to define additional errors starting from 256.
=1 The requested Key-Value Storage or File Storage is not configured in the AUTOSAR model.
kKeyNotFound
=2 The provided key cannot be not found in the Key-Value Storage.
kIllegalWriteAccess
=3 The operation could not be performed because the accessed Key-Value Storage or File Storage is configured as read-only or write-only-once.
kPhysicalStorageFailure
=4 An error occurred when accessing the physical storage, e.g. because of a corrupted file system or corrupted hardware, or because of insufficient access rights.
kIntegrityCorrupted
=5 The structural integrity of the Key-Value Storage or File Storage could not be established. This can happen when the internal structure of a Key-Value Storage or the metadata of a File Storage is corrupted.
kValidationFailed
=6 The validation of redundancy measures failed for a single key-value pair, for the whole Key-Value Storage, for a single file, or for the whole File Storage.
kEncryptionFailed
=7 The encryption or decryption failed for a single key-value pair, for the whole Key-Value Storage, for a single file, or for the whole File Storage.
kDataTypeMismatch
=8 The provided data type does not match the stored data type.
kInitValueNotAvailable
=9 The operation could not be performed because no initial value is available.
kResourceBusy
= 10 The operation could not be performed because the resource is currently busy.
kOutOfStorageSpace
= 12 The physical storage space was exceeded.
kFileNotFound
= 13 The requested file name cannot be not found in the File Storage.
kInvalidPosition
= 15 SetPosition tried to move to a position that is not reachable (i.e. which is smaller than zero or greater than the current size of the file).
kEof
= 16 The Persistency user tried to read from the end of the file or from an empty file.
kInvalidOpenMode
= 17 Opening a file failed because the requested combination of Open Modes is invalid.
kInvalidSize
= 18 SetFileSize tried to set a new size that is bigger than the current file size.
kTooManyFiles
= 19 The maximum number of files was exceeded.
kQuotaExceeded
= 20 The allocated storage quota was exceeded.
kAuthenticationFailed
= 21 Calculating or checking of the MAC failed for a single key-value pair, for the whole Key-Value Storage, for a single file, or for the whole File Storage.
Request a governed re-review of this record. The record is not changed immediately.
=1 A Key-Value Storage was corrupted, an insufficient number of valid copies existed. storage contains the short-name path of the Key-Value Storage, reportedElements is empty, reportedInstances contains the indices of the affected Key-Value Storage copies.
kKeyValueStorageRecovered
=2 A Key-Value Storage was corrupted, but a sufficient number of valid copies existed. storage contains the short-name path of the Key-Value Storage, reportedElements is empty, reportedInstances contains the indices of the affected Key-Value Storage copies.
kKeyRecoveryFailed
=3 A set of key-value pairs was corrupted, an insufficient number of valid copies existed. storage contains the short-name path of the Key-Value Storage, reportedElements contains the list of affected keys, reportedInstances contains the indices of the affected Key-Value Storage or key-value pair copies. In general, the nth key in reportedElements corresponds to the nth index in reported Instances, i.e. a key may be reported several times if several copies are broken. In case only one key-value pair is affected, reported Elements may be provided containing just this key.
kKeyRecovered
=4 A set of key-value pairs was corrupted, but a sufficient number of valid copies existed. storage contains the short-name path of the Key-Value Storage, reportedElements contains the list of affected keys, reportedInstances contains the indices of the affected Key-Value Storage or key-value pair copies. In general, the nth key in reportedElements corresponds to the nth index in reported Instances, i.e. a key may be reported several times if several copies are broken. In case only one key-value pair is affected, reported Elements may be provided containing just this key.
kFileStorageRecoveryFailed
=5 A File Storage was corrupted, an insufficient number of valid copies existed. storage contains the short-name path of the File Storage, reportedElements is empty, reportedInstances contains the indices of the affected File Storage copies.
kFileStorageRecovered
=6 A File Storage was corrupted, but a sufficient number of valid copies existed. storage contains the short-name path of the File Storage, reportedElements is empty, reportedInstances contains the indices of the affected File Storage copies.
kFileRecoveryFailed
=7 A set of files was corrupted, an insufficient number of valid copies existed. storage contains the short-name path of the File Storage, reportedElements contains the list of affected file names, reported Instances contains the indices of the affected File Storage or file copies. In general, the nth file name in reportedElements corresponds to the nth index in reportedInstances, i.e. a file name may be reported several times if several copies are broken. In case only one file is affected, reportedElements may be provided containing just this file name.
kFileRecovered
=8 A set of files was corrupted, but a sufficient number of valid copies existed. storage contains the short-name path of the File Storage, reportedElements contains the list of affected file names, reported Instances contains the indices of the affected File Storage or file copies. In general, the nth file name in reportedElements corresponds to the nth index in reportedInstances, i.e. a file name may be reported several times if several copies are broken. In case only one file is affected, reportedElements may be provided containing just this file name.
Request a governed re-review of this record. The record is not changed immediately.
Checks for updates of the Persistency Target Configuration. This method can be used to detect configuration updates that are installed by UCM while the Adaptive Application that uses Persistency is running. To re-read the updated Target Configuration, the Adaptive Application needs to call ara::per:: ReloadPersistencyManifest.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: b1f49db8b33dProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
usar
A função síncrona CheckForManifestUpdate do cabeçalho ara/per/update.h verifica no namespace ara::per se existem atualizações da Persistency Target Configuration [SWS_PER_00576]. Ela serve para detectar alterações de configuração que foram aplicadas pelo Update and Configuration Management (UCM) enquanto a Adaptive Application que utiliza Persistency já está em execução [SWS_PER_00576]. A função não recebe parâmetros e retorna um ara::core::Result<bool>: true se a configuração tiver sido atualizada desde a última leitura, ou false se tiver permanecido inalterada [SWS_PER_00576].
Tratamento de erros e simultaneidade
A função é declarada como noexcept e segura contra exceções (exception safe), mas não thread-safe (not thread-safe) [SWS_PER_00576]. Em caso de erro, o resultado contém erros específicos do fornecedor ou um dos seguintes códigos de erro [SWS_PER_00576]:
kPhysicalStorageFailure: Ocorre quando o acesso à memória física falha durante a verificação [SWS_PER_00576].
kIntegrityCorrupted: Ocorre quando dados armazenados não podem ser lidos devido à integridade estrutural corrompida [SWS_PER_00576].
Interação
Se for detectada uma atualização (valor de retorno true), a aplicação deve, em seguida, chamar ara::per::ReloadPersistencyManifest para efetivamente reler a Target Configuration alterada [SWS_PER_00576].
Este texto foi gerado por uma IA e serve como guia de orientação com base na especificação.
A Result containing true if the Target Configuration was updated or false if it is unchanged since the last time the Target Configuration was read. In case of an error, it contains any of the errors defined below, or a vendor specific error.
Fehler
Fehlercode
Beschreibung
kPhysicalStorage-Failure
rollback_semantics Returned if access to the physical storage fails during the checking operation.
kIntegrityCor-rupted
rollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
Request a governed re-review of this record. The record is not changed immediately.
Removes backup data and other unused data of all Persistency Key-Value Storages and File Storages.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: ce1bea3039deProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
usar
A função síncrona CleanUpPersistency de ara/per/update.h serve para a remoção de dados de backup (Backup Data) e outros dados não utilizados através de todos os Key-Value Storages e File Storages de uma instância [SWS_PER_00567]. Ela não recebe parâmetros e retorna o resultado por meio do tipo de retorno ara::core::Result<void>[SWS_PER_00567].
Simultaneidade e restrições
A função não é thread-safe (not thread-safe) e exige acesso exclusivo a todos os recursos de armazenamento [SWS_PER_00567]. Se um ara::per::SharedHandle de um Key-Value Storage ou File Storage ainda estiver aberto, a chamada falhará com kResourceBusy[SWS_PER_00567]. Da mesma forma, operações em execução paralela como UpdatePersistency, ResetPersistency, RecoverKeyValueStorage, ResetKeyValueStorage, RecoverAllFiles ou ResetAllFiles levam ao código de erro kResourceBusy[SWS_PER_00567].
Aplica-se uma semântica de rollback relativa ao armazenamento para erros ocorridos [SWS_PER_00567]. Entre os erros possíveis estão, além de kResourceBusy:
kPhysicalStorageFailure em caso de erros no acesso à mídia de armazenamento física [SWS_PER_00567],
kIntegrityCorrupted em caso de corrupção estrutural dos dados armazenados [SWS_PER_00567],
kValidationFailed em caso de falha na verificação da validade dos dados [SWS_PER_00567],
kEncryptionFailed em caso de erros durante a criptografia ou descriptografia [SWS_PER_00567],
kAuthenticationFailed em caso de falha no cálculo ou na verificação do MAC [SWS_PER_00567],
bem como códigos de erro específicos do fabricante [SWS_PER_00567].
Este texto foi gerado por uma IA com base na especificação.
Returns the space in bytes currently occupied by a File Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the File Storage is not opened and no other operation on the File Storage takes place at the same time.
Returns the space in bytes currently occupied by a Key-Value Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the Key-Value Storage is not opened and no other operation on the Key-Value Storage takes place at the same time.
Opens a File Storage. OpenFileStorage will fail with kResourceBusy when the File Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. Because multiple threads can access the same File Storage concurrently, the File Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same File Storage went out of scope.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 14078ca86bfbProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função síncrona ara::per::OpenFileStorage abre um armazenamento de ficheiros para dados persistentes e disponibiliza-o através de um handle de acesso partilhado [SWS_PER_00116]. Como parâmetro, espera uma referência para um ara::core::InstanceSpecifier, que indica o caminho shortName de um protótipo de porta tipado por um PersistencyFileStorageInterface. O valor de retorno é um ara::core::Result<ara::core::SharedHandle<FileStorage>>[SWS_PER_00116].
Quanto à concorrência, a função está especificada como thread-safe e exception-safe [SWS_PER_00116]. Como múltiplas threads podem aceder em paralelo à mesma instância de armazenamento de ficheiros, o armazenamento físico não é obrigatoriamente fechado quando um único SharedHandle sai do âmbito de validade. O fecho ocorre apenas quando todos os handles de referência tiverem saído do âmbito (out-of-scope) [SWS_PER_00116].
Em caso de erro, o Result contém códigos de erro da enumeração PerErrc ou erros específicos do fabricante [SWS_PER_00116]:
PerErrc::kResourceBusy: é retornado quando são executadas simultaneamente operações administrativas como CleanUpPersistency, ResetPersistency, RecoverAllFiles ou ResetAllFiles. Enquanto UpdatePersistency estiver ativo, este erro ocorre caso a chamada se realize fora do callback registado através de RegisterApplicationDataUpdateCallback ou com um identificador divergente [SWS_PER_00116], [SWS_PER_00356].
Erros de configuração e de acesso: kStorageNotFound em caso de instância não configurada, kPhysicalStorageFailure em caso de erros do armazenamento físico, bem como kIntegrityCorrupted, kValidationFailed, kEncryptionFailed e kAuthenticationFailed em caso de problemas de integridade, verificação ou desencriptação [SWS_PER_00116].
Limites de capacidade em atualizações implícitas: kOutOfStorageSpace, kTooManyFiles ou kQuotaExceeded[SWS_PER_00116].
Na interação com o módulo, uma reposição prévia por meio de ResetPersistency faz com que os armazenamentos de ficheiros eliminados sejam recriados na próxima chamada de OpenFileStorage[SWS_PER_00358]. Se forem atualizados dados durante a abertura, um callback de indicação registado através de RegisterDataUpdateIndication é chamado diretamente no contexto de OpenFileStorage[SWS_PER_00578].
Este texto foi gerado por uma IA com base na especificação AUTOSAR Adaptive R25-11.
rollback_semantics Returned if CleanUpPersistency, or ResetPersistency is currently being executed, or if RecoverAllFiles or ResetAllFiles is currently being executed for the same File Storage. Also, while Update Persistency is currently being executed, this error is returned when OpenFileStorage is called outside of the callback registered via RegisterApplicationDataUpdateCallback, or if the used Instance Specifier differs from the one provided by the callback.
no_rollback_semantics Returned if the available physical storage space is insufficient for the files that are added/updated during an implicit update of the File Storage.
rollback_semantics Returned if the files that are added/updated during an implicit update of the File Storage would exceed the configured maximum AllowedSize.
Opens a Key-Value Storage. OpenKeyValueStorage will fail with kResourceBusy when the Key-Value Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. Because multiple threads can access the same Key-Value Storage concurrently, the Key-Value Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same Key-Value Storage went out of scope.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: d24427922381Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
Utilização e ciclo de vida
A função síncrona OpenKeyValueStorage abre um armazenamento de chave-valor e está especificada como thread-safe, bem como noexcept[SWS_PER_00052]. Como parâmetro kvs é passado um ara::core::InstanceSpecifier que referencia o caminho de um PortPrototype tipado por um PersistencyKeyValueStorageInterface. O retorno ocorre como ara::core::Result<SharedHandle<KeyValueStorage>>. Como múltiplas threads podem abrir o mesmo armazenamento concorrentemente, o Persistency só fecha o armazenamento físico quando todas as instâncias de SharedHandle que o referenciam tiverem saído do seu âmbito de validade [SWS_PER_00052].
Tratamento de erros e simultaneidade
Em caso de erro, o Result fornece códigos de erro específicos do domínio de erros do Persistency [SWS_PER_00052]:
PerErrc::kStorageNotFound: o identificador não corresponde a nenhuma interface configurada do Executable.
PerErrc::kResourceBusy: ocorre se CleanUpPersistency, ResetPersistency[SWS_PER_00358], RecoverKeyValueStorage ou ResetKeyValueStorage forem executados concorrentemente para este armazenamento. Durante UpdatePersistency, a chamada só é permitida dentro do callback registado através de RegisterApplicationDataUpdateCallback com o identificador de instância ali passado [SWS_PER_00356].
PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed e PerErrc::kAuthenticationFailed em caso de anomalias, erros de validação ou de criptografia.
PerErrc::kOutOfStorageSpace e PerErrc::kQuotaExceeded em caso de espaço de armazenamento insuficiente ou excesso de quota durante uma atualização implícita.
Interação
Se todos os dados tiverem sido eliminados previamente através de ResetPersistency, o armazenamento será recriado automaticamente na próxima chamada de OpenKeyValueStorage[SWS_PER_00358]. Após a abertura, modificações não guardadas podem ser repostas para o estado da abertura através de DiscardPendingChanges[SWS_PER_00365]. Além disso, a abertura pode desencadear a execução de callbacks registados através de RegisterDataUpdateIndication[SWS_PER_00578].
Esta nota de uso foi gerada automaticamente com base nos requisitos da especificação.
A Result containing a SharedHandle for the KeyValueStorage. In case of an error, it contains any of the errors defined below, or a vendor specific error.
Fehler
Fehlercode
Beschreibung
Found
Returned if the passed InstanceSpecifier does not match any PersistencyKeyValueStorageInterface configured for this Executable.
rollback_semantics Returned if CleanUpPersistency, or ResetPersistency is currently being executed, or if RecoverKeyValueStorage or ResetKeyValue Storage is currently being executed for the same Key-Value Storage. Also, while UpdatePersistency is currently being executed, this error is returned when OpenKeyValueStorage is called outside of the callback registered via RegisterApplicationDataUpdate Callback, or if the used InstanceSpecifier differs from the one provided by the callback.
no_rollback_semantics Returned if the available physical storage space is insufficient for the values that are added/updated during an implicit update of the Key-Value Storage.
rollback_semantics Returned if the values that are added/updated during an implicit update of the Key-Value Storage would exceed the configured maximumAllowedSize.
Recovers a File Storage, including all files. RecoverAllFiles recovers a File Storage when the redundancy checks fail. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. This method does a best-effort recovery of all files. After recovery, files might show outdated or initial content, or might be lost.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: ca84cc440ba3Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função RecoverAllFiles realiza uma restauração de um armazenamento baseado em arquivos (File Storage), incluindo todos os arquivos nele contidos, quando as verificações de redundância falham [SWS_PER_00335]. A chamada é feita de forma síncrona com a especificação do InstanceSpecifier para o protótipo de porta configurado e retorna um ara::core::Result<void>[SWS_PER_00335].
A restauração opera no princípio de melhor esforço (best-effort): após a conclusão, os arquivos podem apresentar conteúdo desatualizado, ter sido redefinidos para seu estado inicial ou ser completamente perdidos [SWS_PER_00335]. Se o acesso ao meio de armazenamento falhar (PerErrc::kPhysicalStorageFailure) ou se o espaço de armazenamento for insuficiente (PerErrc::kOutOfStorageSpace), não haverá garantia de rollback [SWS_PER_00335]. Se ocorrer um erro durante a criptografia (PerErrc::kEncryptionFailed), verificação de integridade (PerErrc::kAuthenticationFailed) ou limitação de tamanho de armazenamento (PerErrc::kQuotaExceeded), a semântica de rollback entrará em ação [SWS_PER_00335]. Se o identificador não corresponder a nenhuma interface configurada, isso resultará em PerErrc::kStorageNotFound[SWS_PER_00335].
Embora a função seja thread-safe, a execução falhará com PerErrc::kResourceBusy se o armazenamento estiver aberto ou houver um handle compartilhado ativo [SWS_PER_00335], [SWS_PER_00116]. Da mesma forma, execuções concorrentes de ResetAllFiles[SWS_PER_00336] para o mesmo armazenamento, bem como as operações globais de atualização UpdatePersistency[SWS_PER_00357], ResetPersistency[SWS_PER_00358] e CleanUpPersistency[SWS_PER_00567], bloqueiam a chamada [SWS_PER_00335].
Esta nota de uso foi elaborada por uma IA com base nas especificações.
rollback_semantics Returned if UpdatePersistency, CleanUpPersistency, or Reset Persistency is currently being executed, or if ResetAllFiles is currently being executed for the same File Storage, or a Shared Handle of the same File Storage is currently in use.
Recovers a Key-ValueStorage. RecoverKeyValueStorage allows to recover a Key-Value Storage when the redundancy checks fail. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. This method does a best-effort recovery of all key-value pairs. After recovery, keys might show outdated or initial value, or might be lost.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: ba269bfce693Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função síncrona RecoverKeyValueStorage no espaço de nomes ara::per serve para restaurar um armazenamento de chave-valor após falhas nas verificações de redundância ([SWS_PER_00333]). É transmitido como parâmetro kvs um ara::core::InstanceSpecifier que referencia o caminho ShortName de um PortPrototype correspondente ([SWS_PER_00333]). O restauro ocorre de acordo com o princípio de melhor esforço (best-effort); após o processo, as chaves podem apresentar valores obsoletos ou iniciais, ou serem totalmente perdidas ([SWS_PER_00333]).
Embora a função esteja especificada como segura para threads, a execução falha com o código de erro PerErrc::kResourceBusy caso o respetivo armazenamento de chave-valor esteja aberto – ou seja, se existir pelo menos um SharedHandle ativo ([SWS_PER_00052], [SWS_PER_00333]). O mesmo erro ocorre se outras threads chamarem simultaneamente funções de modificação: UpdatePersistency ([SWS_PER_00357]), CleanUpPersistency ([SWS_PER_00567]), ResetPersistency ([SWS_PER_00358]) ou ResetKeyValueStorage ([SWS_PER_00334]). Durante o restauro, uma chamada de OpenKeyValueStorage também falha com kResourceBusy ([SWS_PER_00052]).
O resultado é devolvido de forma síncrona como ara::core::Result<void>. Além de PerErrc::kResourceBusy, estão definidos os seguintes erros específicos ([SWS_PER_00333]):
PerErrc::kStorageNotFound: O identificador fornecido não corresponde a nenhuma interface configurada.
PerErrc::kPhysicalStorageFailure: O acesso ao armazenamento físico falha (sem semântica de rollback).
PerErrc::kOutOfStorageSpace: Espaço de armazenamento físico insuficiente para os dados restaurados (sem semântica de rollback).
PerErrc::kQuotaExceeded: Excedido o comprimento máximo configurado (maximumAllowedSize).
PerErrc::kEncryptionFailed e PerErrc::kAuthenticationFailed: Erro na encriptação ou no cálculo do MAC.
Este texto foi gerado por uma IA com base na especificação AUTOSAR.
rollback_semantics Returned if UpdatePersistency, CleanUpPersistency, or Reset Persistency is currently being executed, or if ResetKeyValue Storage is currently being executed for the same Key-Value Storage, or a SharedHandle of the same Key-Value Storage is currently in use.
Registers an application data update callback with Persistency. The provided callback function will be called by Persistency if an update of stored application data might be necessary. This decision is based on the contract versions. The contract version that last accessed Persistency is provided as an argument to the callback, as well as the ara::core::InstanceSpecifier referring to the updated Key- Value Storage or File Storage. Based on this information, the Adaptive Application can decide which updates are actually necessary, e.g. a migration from any older contract version could be supported, with different steps required for each of these. The provided function will be called from the context of ara::per::UpdatePersistency, ara::per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
The callback function to be called by Persistency after an update of persistent data took place. The function will be called with the shortName path of an updated Key-Value Storage or File Storage, and with the contract version with which the Persistency was last accessed.
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
Registers a data update indication callback with Persistency. The provided callback function will be called by Persistency when an update of stored data happened. It will be called from the context of ara::per::UpdatePersistency, ara:: per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
The callback function to be called by Persistency after an update of persistent data took place. The function will be called with the shortName path of an updated Key-Value Storage or File Storage, and with the the updated elements of the storage.
monitoredStorage
A Key-Value Storage or File Storage for which updates shall be reported.
monitoredElements
A set of elements for which updates shall be reported.
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
Register a recovery reporting callback with Persistency. This callback can be used in safety-aware Adaptive Applications to detect actions of the Persistency that are related to the correctness of the persisted data and the reliability of the storage.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 5828fc3d3f00ProcedênciaPerguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função RegisterRecoveryReportCallback no namespace ara::per ([SWS_PER_00433]) serve para registar uma rotina de callback junto do componente Persistency. É utilizada em Adaptive Applications orientadas para a segurança a fim de detetar medidas de correção do Persistency relativas à exatidão de dados persistidos bem como à fiabilidade do armazenamento [SWS_PER_00433].
Parâmetros e semântica de chamada
Como parâmetro é transmitido recoveryReportCallback, uma std::function que é chamada pelo Persistency quando erros nos dados armazenados tiverem sido corrigidos com sucesso com recurso à redundância disponível [SWS_PER_00433]. São transmitidas ao callback as seguintes informações de contexto [SWS_PER_00433]:
storage: o caminho (shortName) do Key-Value Storage ou File Storage afetado como ara::core::InstanceSpecifier.
recoveryReportKind: o tipo de relatório de recuperação (ara::per::RecoveryReportKind).
reportedElements: um vetor de identificadores dos elementos afetados (ara::core::Vector<ara::core::String>).
reportedInstances: um vetor das instâncias afetadas (ara::core::Vector<std::uint8_t>).
Tratamento de erros e simultaneidade
A função não devolve qualquer valor e está declarada como noexcept; é considerada segura contra exceções (exception safe) [SWS_PER_00433]. Não existem códigos de erro próprios [SWS_PER_00433]. No que diz respeito à segurança de threads, a interface está classificada como not thread-safe[SWS_PER_00433]. A chamada deverá, portanto, ocorrer tipicamente na fase de inicialização da aplicação antes do início de acessos concorrentes ao armazenamento. Pergunta Q-e5b93ea58fb56a1c (aberta)
Esta nota de utilização foi criada por uma IA e baseia-se nas especificações da plataforma AUTOSAR.
The callback function to be called by Persistency to report errors in the stored data that were corrected using the available redundancy. The function will be called with the shortName path of the affected Key-Value Storage or File Storage in storage and information on what has been corrected, placed in the parameters recoveryReport Kind, reportedElements, and reportedInstances.
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
Re-reads the Target Configuration. This method can be used to prepare for updates of the Key-Value Storages and File Storages of Persistency after a new Target Configuration was installed by UCM while the Adaptive Application that uses Persistency is running. Storages are only updated after closing them, either when they are opened again or by an explicit call to ara:: per::UpdatePersistency.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 19920ccb9cf9ProcedênciaPerguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função síncrona ReloadPersistencyManifest do namespace ara::per (declarada em #include "ara/per/update.h") relê a configuração de destino (Target Configuration) de Persistency [SWS_PER_00577]. Ela serve para preparar atualizações dos Key-Value Storages e File Storages após uma nova configuração de destino ter sido instalada pelo Update and Config Management (UCM) durante o tempo de execução da Adaptive Application [SWS_PER_00577].
Tipicamente, a aplicação verifica previamente com CheckForManifestUpdate[SWS_PER_00576] se existe uma atualização de configuração e chama, em seguida, ReloadPersistencyManifest[SWS_PER_00576]. A nova leitura, no entanto, ainda não atualiza imediatamente os armazenamentos persistentes: os Storages só são atualizados após o seu fechamento – seja na reabertura ou através de uma chamada explícita a ara::per::UpdatePersistency[SWS_PER_00577]. Interpretação: Presume-se que as áreas de armazenamento já abertas não sejam fechadas automaticamente pela chamada, de modo que a aplicação deve fechá-las por si própria ou atualizá-las explicitamente. Pergunta Q-16f9dae418feb3fa (aberta)
A função não recebe parâmetros e retorna um ara::core::Result<void>[SWS_PER_00577]. Em caso de erro, o resultado contém erros específicos do fornecedor ou um dos seguintes códigos de erro com semântica de rollback [SWS_PER_00577]:
kPhysicalStorageFailure: Ocorre quando o acesso à memória física falha durante a operação de leitura [SWS_PER_00577].
kIntegrityCorrupted: Ocorre quando dados armazenados não podem ser lidos devido à integridade estrutural corrompida [SWS_PER_00577].
Em relação à concorrência, a função é especificada como não thread-safe (not thread-safe), mas declarada como segura contra exceções (exception safe) e noexcept[SWS_PER_00577]. Chamadas paralelas devem, portanto, ser sincronizadas pelo lado da aplicação.
Esta nota de uso foi elaborada por uma IA com base na especificação.
Resets a File Storage, including all files. ResetAllFiles resets a File Storage to the initial state, containing only the files which were deployed from the Target Configuration, with their initial content. Afterwards, the File Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: f645139d391cProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função ResetAllFiles redefine um File Storage de forma síncrona para o seu estado de entrega inicial de acordo com a Target Configuration atual [SWS_PER_00336]. Após a execução bem-sucedida, o armazenamento conterá exclusivamente os arquivos ali definidos com seus conteúdos originais, como se tivesse acabado de ser instalado [SWS_PER_00336].
Uso e concorrência: por meio do parâmetro fs, é passado o identificador de instância de um PortPrototype tipado via PersistencyFileStorageInterface[SWS_PER_00336]. Embora a função seja especificada como thread-safe e exception safe, ela pressupõe acesso exclusivo ao armazenamento: se o armazenamento estiver aberto no momento (por exemplo, por meio de um SharedHandle ativo de OpenFileStorage[SWS_PER_00116]) ou for modificado em paralelo por UpdatePersistency[SWS_PER_00357], CleanUpPersistency[SWS_PER_00567], ResetPersistency[SWS_PER_00358], RecoverAllFiles[SWS_PER_00335] ou por outra chamada de ResetAllFiles, a execução falhará [SWS_PER_00336].
Tratamento de erros: a função retorna um ara::core::Result<void>[SWS_PER_00336]. Possíveis códigos de erro de PerErrc são:
kResourceBusy: o armazenamento de arquivos está aberto ou está sendo modificado em paralelo (semântica de rollback) [SWS_PER_00336].
kStorageNotFound: o identificador não corresponde a nenhuma interface configurada para o executável [SWS_PER_00336].
kPhysicalStorageFailure ou kOutOfStorageSpace: erro físico de armazenamento ou espaço de armazenamento insuficiente (sem semântica de rollback) [SWS_PER_00336].
kEncryptionFailed ou kAuthenticationFailed: erro na criptografia ou cálculo de MAC (semântica de rollback) [SWS_PER_00336].
Interação: após a redefinição, os arquivos restaurados têm o status FileCreationState::kCreatedDuringReset[SWS_PER_00435] e FileModificationState::kModifiedDuringReset[SWS_PER_00436] em consultas de estado.
Esta nota de utilização foi gerada por uma IA com base na especificação AUTOSAR R25-11.
rollback_semantics Returned if UpdatePersistency, CleanUpPersistency, or Reset Persistency is currently being executed, or if RecoverAllFiles is currently being executed for the same File Storage, or a Shared Handle of the same File Storage is currently in use.
Resets a Key-Value Storage to the initial state. ResetKeyValueStorage allows to reset a Key-Value Storage to the initial state, containing only key-value pairs which were deployed from the Target Configuration, with their initial values. Afterwards, the Key-Value Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 48697319880fProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
A função síncrona ResetKeyValueStorage repõe um Key-Value-Storage específico para o seu estado inicial [SWS_PER_00334]. Após uma execução bem-sucedida, o armazenamento contém exclusivamente os pares chave-valor com os respetivos valores iniciais que foram disponibilizados através da Target Configuration; o armazenamento comporta-se depois como se tivesse acabado de ser instalado a partir da configuração atual [SWS_PER_00334]. Como parâmetro, é passado o caminho de kvs como ara::core::InstanceSpecifier, que referencia o PortPrototype de uma PersistencyKeyValueStorageInterface configurada [SWS_PER_00334].
A função está especificada como thread-safe e exception safe, mas está sujeita a condições de concorrência estritas relativas a armazenamentos abertos e operações globais de persistência [SWS_PER_00334]:
A chamada falha com PerErrc::kResourceBusy se o respetivo Key-Value-Storage estiver atualmente aberto (ou seja, se ainda existir um SharedHandle, consulte [SWS_PER_00052]) ou se for executado em simultâneo um restauro através de RecoverKeyValueStorage[SWS_PER_00333] no mesmo armazenamento [SWS_PER_00334].
Uma execução paralela das operações globais UpdatePersistency[SWS_PER_00357], CleanUpPersistency[SWS_PER_00567], ResetPersistency[SWS_PER_00358] ou uma chamada concorrente de ResetKeyValueStorage noutra thread também resulta em kResourceBusy[SWS_PER_00334].
Como resultado, a função fornece um ara::core::Result<void>[SWS_PER_00334]. Em caso de erro, além de kResourceBusy ocorrem os seguintes códigos de erro específicos: PerErrc::kStorageNotFound (InstanceSpecifier inválido), PerErrc::kPhysicalStorageFailure (erro de acesso ao suporte de armazenamento, sem semântica de rollback), PerErrc::kOutOfStorageSpace (espaço de armazenamento insuficiente para valores iniciais, sem semântica de rollback), PerErrc::kEncryptionFailed (erro de encriptação), bem como PerErrc::kAuthenticationFailed (erro no cálculo do MAC) [SWS_PER_00334].
Esta nota de uso foi gerada por uma IA com base na especificação AUTOSAR R25-11.
rollback_semantics Returned if UpdatePersistency, CleanUpPersistency, or Reset Persistency is currently being executed, or if RecoverKeyValue Storage is currently being executed for the same Key-Value Storage, or a SharedHandle of the same Key-Value Storage is currently in use.
Resets all Key-Value Storages and File Storages by entirely removing their content. The Key-Value Storages and File Storages will be re-created when ara::per:: OpenFileStorage or ara::per::OpenKeyValueStorage is called next time.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: d1720067a24eProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
usar
A função síncrona ResetPersistency ([SWS_PER_00358]) do cabeçalho ara/per/update.h destina-se à redefinição completa de todos os Key-Value Storages e File Storages de uma aplicação. Durante a chamada, todos os conteúdos persistentes são completamente excluídos. Os próprios armazenamentos não são recriados imediatamente, mas apenas na próxima chamada respectiva de ara::per::OpenKeyValueStorage ([SWS_PER_00052]) ou ara::per::OpenFileStorage ([SWS_PER_00116]). Arquivos disponibilizados novamente após o reset recebem o status de criação FileCreationState::kCreatedDuringInstallation ([SWS_PER_00435]).
Tratamento de erros
Como valor de retorno, a função fornece um ara::core::Result<void> ([SWS_PER_00358]). Se o acesso ao meio de armazenamento físico falhar durante a operação, a função retorna kPhysicalStorageFailure sem semântica de rollback. Se recursos persistentes estiverem ocupados ou forem modificados em paralelo, a chamada é cancelada com kResourceBusy e semântica de rollback ativa ([SWS_PER_00358]). Além disso, podem ocorrer erros específicos do fabricante.
Simultaneidade e restrições
A interface está declarada como exception safe, mas explicitamente classificada como not thread-safe ([SWS_PER_00358]). Ela falha com kResourceBusy assim que:
já estiverem sendo executadas operações globais como UpdatePersistency ([SWS_PER_00357]) ou CleanUpPersistency ([SWS_PER_00567]),
um armazenamento individual estiver sendo editado em paralelo por meio de RecoverKeyValueStorage, ResetKeyValueStorage, RecoverAllFiles ([SWS_PER_00335]) ou ResetAllFiles ([SWS_PER_00336]),
ou ainda existir pelo menos um SharedHandle ativo de um Key-Value Storage ou File Storage ([SWS_PER_00358]).
Enquanto ResetPersistency estiver em execução, tentativas simultâneas de abertura por meio de OpenKeyValueStorage ([SWS_PER_00052]) ou OpenFileStorage ([SWS_PER_00116]) em outras threads também resultam em kResourceBusy.
Este texto foi criado por uma IA. As especificações AUTOSAR são determinantes.
Updates all Persistency Key-Value Storages and File Storages after a new Target Configuration was installed. This method can be used to update the persistent data of the Adaptive Application during verification phase.
GERADO POR IAnão revisadoModelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: a05074f12eedProcedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão
usar
A função síncrona ara::per::UpdatePersistency ([SWS_PER_00357], cabeçalho ara/per/update.h) atualiza, após a instalação de uma nova configuração de destino, todos os key-value storages e file storages de uma aplicação. Ela serve para atualizar os dados persistentes de uma Adaptive Application durante a fase de verificação [SWS_PER_00357]. A função não aceita parâmetros de entrada e retorna um ara::core::Result<void>[SWS_PER_00357].
Tratamento de erros
Em caso de erro, o Result retornado contém um código de erro específico ou um erro específico do fabricante [SWS_PER_00357]. Diferencia-se, neste contexto, entre operações com e sem semântica de reversão (rollback):
Semântica de reversão: em kIntegrityCorrupted, kValidationFailed, kEncryptionFailed, kAuthenticationFailed, kTooManyFiles (excesso de maxNumberOfFiles), kQuotaExceeded (excesso de MaximumAllowedSize), bem como kResourceBusy, as alterações efetuadas são revertidas [SWS_PER_00357].
Sem semântica de reversão: em caso de falhas físicas de memória (kPhysicalStorageFailure), bem como de espaço de armazenamento físico insuficiente (kOutOfStorageSpace), nenhuma reversão é garantida [SWS_PER_00357].
Simultaneidade e restrições
A função está especificada como segura contra exceções (exception safe), mas expressamente como não segura para threads (not thread-safe) [SWS_PER_00357]. Uma chamada falha com kResourceBusy assim que um SharedHandle de um key-value storage ou file storage ainda estiver em uso ou funções de manutenção como CleanUpPersistency[SWS_PER_00567], ResetPersistency[SWS_PER_00358], RecoverKeyValueStorage[SWS_PER_00333], ResetKeyValueStorage[SWS_PER_00334], RecoverAllFiles[SWS_PER_00335] ou ResetAllFiles[SWS_PER_00336] forem executadas em paralelo [SWS_PER_00357]. Por outro lado, chamadas simultâneas de OpenKeyValueStorage[SWS_PER_00052] e OpenFileStorage[SWS_PER_00116] a partir de outras threads durante a atualização também falham com kResourceBusy.
Interação
Se uma nova configuração de destino foi instalada pelo UCM durante a operação contínua e lida novamente através de ReloadPersistencyManifest[SWS_PER_00577], os armazenamentos fechados são atualizados via UpdatePersistency. Se anteriormente foram registrados callbacks via RegisterDataUpdateIndication[SWS_PER_00578] ou RegisterApplicationDataUpdateCallback[SWS_PER_00356], sua chamada ocorre de forma síncrona no contexto de UpdatePersistency[SWS_PER_00578].
Esta nota de utilização foi gerada automaticamente com base na especificação AUTOSAR R25-11.
no_rollback_semantics Returned if the available physical storage space is insufficient for the update.
kTooManyFiles
rollback_semantics Returned if the files added during the update of any File Storage would exceed the configured PersistencyFileStorageInterface.maxNumberOfFiles.
kQuotaExceeded
rollback_semantics Returned if the update would exceed the configured PersistencyCommon.MaximumAllowedSize of any Key- Value Storage or File Storage.
kAuthentication-Failed
rollback_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.
gemini-3.8-flash-low· 2026-10-13 · Original em alemão