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 物件。
查詢特定的 ProfileData 物件,其中包含以 TLV 讀取器形式提供的設定檔 ID 和 (選用) 執行個體 ID。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回 |
擷取
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 )