nl:: Weave:: Profiles:: DataManagement_Legacy:: ProfileDatabase
这是一个抽象类。
#include <src/lib/profiles/data-management/Legacy/ProfileDatabase.h>
抽象 ProfileDatabase 辅助类。
摘要
WDM 将协议实现与数据管理实现分离开来,至少原则上,将大部分工作留给应用开发者。WDM 中所有有趣的调用以及配置文件开发者需要实现的所有抽象方法都采用 TLV 编码的路径列表或数据列表。这会给配置文件开发者带来负担,并且在实践中会导致大量代码重复,因为当开发者编写相同的代码来打包和解压缩 TLV 等时,会导致大量代码重复。为了稍微简化,我们提供了一种“数据管理工具包”。
如果提供了必要的具体 ProfileData 子类并将其添加至下面的 LookupProfileData() 方法,此辅助类将支持存储和检索数据。
公共函数 |
|
---|---|
LookupDataFromProfileDescriptor(nl::Weave::TLV::TLVReader & aDescReader, ProfileData **aProfileData)
|
在数据库中找到 ProfileData 对象。
|
LookupProfileData(nl::Weave::TLV::TLVReader & aPathReader, ProfileData **aProfileData)
|
在数据库中找到 ProfileData 对象。
|
LookupProfileData(uint32_t aProfileId, nl::Weave::TLV::TLVReader *aInstanceIdRdr, ProfileData **aResult)=0
|
virtual WEAVE_ERROR
查找 ProfileData 对象。
|
Retrieve(ReferencedTLVData & aPathList, ReferencedTLVData & aDataList)
|
根据路径列表检索数据列表。
|
Retrieve(ReferencedTLVData & aPathList, nl::Weave::TLV::TLVWriter & aWriter)
|
给定路径列表,写出数据列表。
|
Store(ReferencedTLVData & aDataList)
|
存储数据列表。
|
受保护的函数 |
|
---|---|
StoreInternal(nl::Weave::TLV::TLVReader & aPathReader, uint64_t aVersion, nl::Weave::TLV::TLVReader & aDataReader)
|
类 |
|
---|---|
nl:: |
抽象 ProfileData 辅助内部类。 |
公共函数
LookupDataFromProfileDescriptor
WEAVE_ERROR LookupDataFromProfileDescriptor( nl::Weave::TLV::TLVReader & aDescReader, ProfileData **aProfileData )
在数据库中找到 ProfileData 对象。
此实用程序方法用于查找特定 ProfileDatabase 中的 ProfileData 对象。这在很大程度上取决于具体 ProfileDatabase 子类的实现者提供的查找方法。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
LookupProfileData
WEAVE_ERROR LookupProfileData( nl::Weave::TLV::TLVReader & aPathReader, ProfileData **aProfileData )
在数据库中找到 ProfileData 对象。
此实用程序方法用于查找特定 ProfileDatabase 中的 ProfileData 对象。这在很大程度上取决于具体 ProfileDatabase 子类的实现者提供的查找方法。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
LookupProfileData
virtual WEAVE_ERROR LookupProfileData( uint32_t aProfileId, nl::Weave::TLV::TLVReader *aInstanceIdRdr, ProfileData **aResult )=0
查找 ProfileData 对象。
根据个人资料 ID 和(可选)实例 ID< 作为 TLV 读取器,查找特定的 ProfileData 对象。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
||||||
返回值 |
检索
WEAVE_ERROR Retrieve( ReferencedTLVData & aPathList, ReferencedTLVData & aDataList )
根据路径列表检索数据列表。
在给定路径列表的情况下,检索一个数据列表,其中包含路径列表中每个路径的数据列表元素,以及作为该路径终点的数据。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
WEAVE_NO_ERROR。成功时。否则,返回 WEAVE_ERROR,表示未能检索到相关数据列表。
|
检索
WEAVE_ERROR Retrieve( ReferencedTLVData & aPathList, nl::Weave::TLV::TLVWriter & aWriter )
给定路径列表,写出数据列表。
给定路径列表和 TLV 写入器,写出一个数据列表,其中包含路径列表中每条路径的数据列表元素,以及作为该路径终点的数据。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
WEAVE_NO_ERROR。成功时。否则,返回 WEAVE_ERROR,表示未能检索到数据或写出相关数据列表。
|
存储
WEAVE_ERROR Store( ReferencedTLVData & aDataList )
存储数据列表。
给定一个 TLV 编码的数据列表,此方法会解析该列表,然后调用 ProfileDatabase 子类实现者提供的具体方法,将引用的数据放在它所属的位置。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
WEAVE_NO_ERROR。成功时。否则,返回 WEAVE_ERROR,表示未能存储相关数据。
|
受保护的函数
StoreInternal
WEAVE_ERROR StoreInternal( nl::Weave::TLV::TLVReader & aPathReader, uint64_t aVersion, nl::Weave::TLV::TLVReader & aDataReader )