Logo
中文版
详情联系: neusar-support@reachauto.com
KeyValueStorageAPI

函数

 ara::per::KeyValueStorage::KeyValueStorage (KeyValueStorage &&kvs)=delete
 移动构造函数 更多...
 
 ara::per::KeyValueStorage::KeyValueStorage ()=delete
 默认构造函数 更多...
 
 ara::per::KeyValueStorage::KeyValueStorage (const KeyValueStorage &)=delete
 拷贝构造函数 更多...
 
KeyValueStorageara::per::KeyValueStorage::operator= (KeyValueStorage &&kvs) &=delete
 移动赋值运算符 更多...
 
KeyValueStorageara::per::KeyValueStorage::operator= (const KeyValueStorage &)=delete
 拷贝赋值运算符 更多...
 
 ara::per::KeyValueStorage::~KeyValueStorage () noexcept=default
 析构函数 更多...
 
ara::core::Result< ara::core::Vector< ara::core::String > > ara::per::KeyValueStorage::GetAllKeys () const noexcept
 返回键值库的可用的键的列表 更多...
 
ara::core::Result< bool > ara::per::KeyValueStorage::KeyExists (ara::core::StringView key) const noexcept
 校验键值库中是否存在指定的键 更多...
 
template<class T >
ara::core::Result< void > ara::per::KeyValueStorage::GetValue (ara::core::StringView key, T &value) const noexcept
 返回键值库中指定键的值 更多...
 
template<class T >
ara::core::Result< T > ara::per::KeyValueStorage::GetValue (ara::core::StringView key) const noexcept
 返回键值库中指定键的值 更多...
 
template<class T >
ara::core::Result< void > ara::per::KeyValueStorage::SetValue (ara::core::StringView key, const T &value) noexcept
 为键值库的一个键设置值 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::RemoveKey (ara::core::StringView key) noexcept
 从键值库中删除指定的键和对应的值 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::RecoverKey (ara::core::StringView key) noexcept
 Function Implementation 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::ResetKey (ara::core::StringView key) noexcept
 Function Implementation 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::RemoveAllKeys () noexcept
 删除键值库中所有的键及关联的值 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::SyncToStorage () noexcept
 将键值库的更新刷新到物理存储 更多...
 
ara::core::Result< void > ara::per::KeyValueStorage::DiscardPendingChanges () noexcept
 删除所有从上次用OpenKeyValueStorage()打开还未调用SyncToStorage()的修改 更多...
 

详细描述

函数说明

◆ DiscardPendingChanges()

ara::core::Result< void > ara::per::KeyValueStorage::DiscardPendingChanges ( )
noexcept

删除所有从上次用OpenKeyValueStorage()打开还未调用SyncToStorage()的修改

Function Implementation

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
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
注解
删除所有从上次用OpenKeyValueStorage()打开还未调用SyncToStorage()的修改
异常
N/A
Swsid
SWS_PER_00365
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kPhysicalStorageFailure Returned if access to the storage fails. PerErrc::kValidationFailed Returned if the validity of stored data cannot be ensured. PerErrc::kIntegrityCorrupted Returned if stored data cannot be read because the structural integrity is corrupted.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00495}

在文件 第 行定义.

◆ GetAllKeys()

ara::core::Result< ara::core::Vector< ara::core::String > > ara::per::KeyValueStorage::GetAllKeys ( ) const
noexcept

返回键值库的可用的键的列表

Function Implementation

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
A Result containing a list of available keys. In case of an error, it contains any of the errors defined below, or a vendor specific error
注解
返回键值库的可用的键的列表
异常
N/A
Swsid
SWS_PER_00042
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00505}

在文件 第 行定义.

◆ GetValue() [1/2]

template<typename T >
ara::core::Result< T > ara::per::KeyValueStorage::GetValue ( ara::core::StringView  key) const
noexcept

返回键值库中指定键的值

模板参数
N/A
参数
[in]keyThe key to look up
[out]N/A
[in,out]N/A
返回
A Result containing the retrieved value. In case of an error, it contains any of the errors defined below, or a vendor specific error.
注解
返回键值库中指定键的值,值类型仅支持上位机支持的类型
异常
N/A
Swsid
SWS_PER_00332
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kKeyNotFound Returned if the provided key does not exist in the Key-Value Storage. PerErrc::kDataTypeMismatch Returned if the data type of stored value does not match the templated type.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00253, SWS_PER_00254, SWS_PER_00496, SWS_PER_00497, SWS_PER_00498}

在文件 第 行定义.

引用了 .

函数调用图:

◆ GetValue() [2/2]

template<class T >
ara::core::Result< void > ara::per::KeyValueStorage::GetValue ( ara::core::StringView  key,
T &  value 
) const
noexcept

返回键值库中指定键的值

模板参数
value
参数
[in]keyThe key to look up
[out]valuekvs pair value
[in,out]N/A
返回
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.
注解
返回键值库中指定键的值,值类型仅支持上位机支持的类型
异常
N/A
Swsid
N/A
符合标准
No
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kKeyNotFound Returned if the provided key does not exist in the Key-Value Storage. PerErrc::kDataTypeMismatch Returned if the data type of stored value does not match the templated type.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00253, SWS_PER_00254, SWS_PER_00496, SWS_PER_00497, SWS_PER_00498}

在文件 第 行定义.

被这些函数引用 .

这是这个函数的调用关系图:

◆ KeyExists()

ara::core::Result< bool > ara::per::KeyValueStorage::KeyExists ( ara::core::StringView  key) const
noexcept

校验键值库中是否存在指定的键

Function Implementation

模板参数
N/A
参数
[in]keyThe key that shall be checked.
[out]N/A
[in,out]N/A
返回
A Result containing true if the key could be located or false if it couldn’t. In case of an error, it contains any of the errors defined below, or a vendor specific error.
注解
校验键值库中是否存在指定的键
异常
N/A
Swsid
SWS_PER_00043
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00253, SWS_PER_00504}

在文件 第 行定义.

◆ KeyValueStorage() [1/3]

ara::per::KeyValueStorage::KeyValueStorage ( )
delete

默认构造函数

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
N/A
注解
默认构造函数
异常
N/A
Swsid
SWS_PER_00459
符合标准
yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}

◆ KeyValueStorage() [2/3]

ara::per::KeyValueStorage::KeyValueStorage ( const KeyValueStorage )
delete

拷贝构造函数

模板参数
N/A
参数
[in]kvsKeyValueStorage object
[out]N/A
[in,out]N/A
返回
N/A
注解
拷贝构造函数,不应被使用
异常
N/A
Swsid
SWS_PER_00324
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}

◆ KeyValueStorage() [3/3]

ara::per::KeyValueStorage::KeyValueStorage ( KeyValueStorage &&  kvs)
delete

移动构造函数

模板参数
N/A
参数
[in]kvsKeyValueStorage object to be moved
[out]N/A
[in,out]N/A
返回
N/A
注解
移动构造函数
异常
N/A
Swsid
SWS_PER_00322
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}

◆ operator=() [1/2]

KeyValueStorage& ara::per::KeyValueStorage::operator= ( const KeyValueStorage )
delete

拷贝赋值运算符

模板参数
N/A
参数
[in]kvsKeyValueStorage object
[out]N/A
[in,out]N/A
返回
KeyValueStorage& KeyValueStorage object
注解
拷贝赋值运算符,不应被使用
异常
N/A
Swsid
SWS_PER_00325
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}

◆ operator=() [2/2]

KeyValueStorage& ara::per::KeyValueStorage::operator= ( KeyValueStorage &&  kvs) &
delete

移动赋值运算符

模板参数
N/A
参数
[in]kvsKeyValueStorage object to be moved
[out]N/A
[in,out]N/A
返回
KeyValueStorage& KeyValueStorage object
注解
移动赋值运算符
异常
N/A
Swsid
SWS_PER_00323
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}

◆ RecoverKey()

ara::core::Result< void > ara::per::KeyValueStorage::RecoverKey ( ara::core::StringView  key)
noexcept

Function Implementation

模板参数
N/A
参数
[in]keyThe key to be recovered.
[out]N/A
[in,out]N/A
返回
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.
注解
恢复此键值存储的单个键值对。此方法允许在冗余检查失败时恢复单个键值对。此方法会尽力恢复键值对。 恢复后,键值对可能包含过时的或初始的内容,或者可能会丢失。 RecoverKey可能会被另一个线程对 RemoveAllKeys、SyncToStorage,或DiscardPendingChanges,或SetValue、GetValue、RemoveKey、RecoverKey 或ResetKey用于相同的键值对
异常
N/A
Swsid
SWS_PER_00427
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kKeyNotFound Returned if the provided key does not exist in the Key-Value Storage. PerErrc::kPhysicalStorageFailure Returned if access to the storage fails. PerErrc::kIntegrityCorrupted Returned if stored data cannot be read because the structural integrity is corrupted.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00453, SWS_PER_00485, SWS_PER_00486, SWS_PER_00253,SWS_PER_00487}

在文件 第 行定义.

◆ RemoveAllKeys()

ara::core::Result< void > ara::per::KeyValueStorage::RemoveAllKeys ( )
noexcept

删除键值库中所有的键及关联的值

Function Implementation

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
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.
注解
删除键值库中所有的键及关联的值
异常
N/A
Swsid
SWS_PER_00048
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kIllegalWriteAccess Returned if the Key-Value Storage is configured as read-only.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00503}

在文件 第 行定义.

引用了 .

函数调用图:

◆ RemoveKey()

ara::core::Result< void > ara::per::KeyValueStorage::RemoveKey ( ara::core::StringView  key)
noexcept

从键值库中删除指定的键和对应的值

Function Implementation

模板参数
N/A
参数
[in]keyThe key to be removed.
[out]N/A
[in,out]N/A
返回
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.
注解
从键值库中删除指定的键和对应的值,调用后,需要调用此类的SyncToStorage完成向物理存储介质的存储,否则进程结束后,变化的信息不会存储到物理介质。
异常
N/A
Swsid
SWS_PER_00047
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kKeyNotFound Returned if the provided key does not exist in the Key-Value Storage. PerErrc::kIllegalWriteAccess Returned if the Key-Value Storage is configured as read-only.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00253, SWS_PER_00502, SWS_PER_00535}

在文件 第 行定义.

引用了 .

函数调用图:

◆ ResetKey()

ara::core::Result< void > ara::per::KeyValueStorage::ResetKey ( ara::core::StringView  key)
noexcept

Function Implementation

模板参数
N/A
参数
[in]keyThe key to be reset.
[out]N/A
[in,out]N/A
返回
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.
注解
将此键值存储的键重置为其初始值。ResetKey 允许将单个键重置为其初始值。
异常
N/A
Swsid
SWS_PER_00426 @isstandard yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kIllegalWriteAccess Returned if the Key-Value Storage is configured as read-only. PerErrc::kPhysicalStorageFailure Returned if access to the storage fails. PerErrc::kIntegrityCorrupted Returned if stored data cannot be read because the structural integrity is corrupted. PerErrc::kInitValueNotAvailable Returned if no intitial value was configured for this key.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00477, SWS_PER_00253}

在文件 第 行定义.

引用了 .

函数调用图:

◆ SetValue()

template<class T >
ara::core::Result< void > ara::per::KeyValueStorage::SetValue ( ara::core::StringView  key,
const T &  value 
)
noexcept

为键值库的一个键设置值

模板参数
value
参数
[in]keyThe key to assign the value to
[in]valueThe value to store
[out]N/A
[in,out]N/A
返回
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.
注解
为键值库的一个键设置值,如果指定键的值已经存在,则覆盖,不管值的类型,值的类型仅支持上位机配置的类型。 调用后,需要调用此类的SyncToStorage完成向物理存储介质的存储,否则进程结束后,变化的信息不会存储到物理介质。
异常
N/A
Swsid
SWS_PER_00046
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kIllegalWriteAccess Returned if the Key-Value Storage is configured as read-only. PerErrc::kDataTypeMismatch Returned if the data type of stored value does not match the templated type.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00253, SWS_PER_00254, SWS_PER_00499, SWS_PER_00534, SWS_PER_00501, SWS_PER_00302, SWS_PER_00303}

在文件 第 行定义.

◆ SyncToStorage()

ara::core::Result< void > ara::per::KeyValueStorage::SyncToStorage ( )
noexcept

将键值库的更新刷新到物理存储

Function Implementation

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
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.
注解
将键值库的更新刷新到物理存储
异常
N/A
Swsid
SWS_PER_00049
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
PerErrc::kIllegalWriteAccess Returned if the Key-Value Storage is configured as read-only. PerErrc::kPhysicalStorageFailure Returned if access to the storage fails. PerErrc::kOutOfStorageSpace Returned if the available storage space is insufficient for the restored value.
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{SWS_PER_00210, SWS_PER_00464, SWS_PER_00449, SWS_PER_00466, SWS_PER_00320, SWS_PER_00494}

在文件 第 行定义.

引用了 .

函数调用图:

◆ ~KeyValueStorage()

ara::per::KeyValueStorage::~KeyValueStorage ( )
defaultnoexcept

析构函数

模板参数
N/A
参数
[in]N/A
[out]N/A
[in,out]N/A
返回
N/A
注解
析构函数
异常
N/A
Swsid
SWS_PER_00050
符合标准
Yes
非标原因
N/A
种类
function
可见
public
线程安全
re-entrant
Fireandforget
no
错误
N/A
头文件
异常安全
noexcept
分类
ara
范围
namespace ara::per::KeyValueStorage @uptrace{N/A}