nl:: Weave:: Profiles:: DataManagement_Legacy:: ProfileDatabase
This is an abstract class.
#include <src/lib/profiles/data-management/Legacy/ProfileDatabase.h>
The abstract ProfileDatabase auxiliary class.
Summary
WDM separates the protocol implementation from the data management implementation and, at least in principle, leaves most of the latter to the application developer. All of the interesting calls in WDM and all of the abstract methods that the profile developer is required to implement take TLV-encoded path lists or data lists. This puts a burden on profile developers and, in practice, will cause a lot of code duplication as developer after developer writes the same code for packing and unpacking TLV and so on. To ease things a bit we provide a kind of "data management toolkit".
This auxiliary class provides support for storing and retrieving data provided that the necessary concrete ProfileData sub-classes have been supplied and added to the LookupProfileData() method below.
Public functions |
|
---|---|
LookupDataFromProfileDescriptor(nl::Weave::TLV::TLVReader & aDescReader, ProfileData **aProfileData)
|
Find a ProfileData object in the database.
|
LookupProfileData(nl::Weave::TLV::TLVReader & aPathReader, ProfileData **aProfileData)
|
Find a ProfileData object in the database.
|
LookupProfileData(uint32_t aProfileId, nl::Weave::TLV::TLVReader *aInstanceIdRdr, ProfileData **aResult)=0
|
virtual WEAVE_ERROR
Look up a ProfileData object.
|
Retrieve(ReferencedTLVData & aPathList, ReferencedTLVData & aDataList)
|
Retrieve a data list given a path list.
|
Retrieve(ReferencedTLVData & aPathList, nl::Weave::TLV::TLVWriter & aWriter)
|
Write out a data list given a path list.
|
Store(ReferencedTLVData & aDataList)
|
Store a data list.
|
Protected functions |
|
---|---|
StoreInternal(nl::Weave::TLV::TLVReader & aPathReader, uint64_t aVersion, nl::Weave::TLV::TLVReader & aDataReader)
|
Classes |
|
---|---|
nl:: |
The abstract ProfileData auxiliary inner class. |
Public functions
LookupDataFromProfileDescriptor
WEAVE_ERROR LookupDataFromProfileDescriptor( nl::Weave::TLV::TLVReader & aDescReader, ProfileData **aProfileData )
Find a ProfileData object in the database.
This utility method is used to find ProfileData objects in a particular ProfileDatabase. It depends largely on lookup methods provided by the implementer of the concrete ProfileDatabase subclass.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
WEAVE_NO_ERROR on success, otherwise return a WEAVE_ERROR indicating a failure to look up a matching ProfileData object.
|
LookupProfileData
WEAVE_ERROR LookupProfileData( nl::Weave::TLV::TLVReader & aPathReader, ProfileData **aProfileData )
Find a ProfileData object in the database.
This utility method is used to find ProfileData objects in a particular ProfileDatabase. It depends largely on lookup methods provided by the implementer of the concrete ProfileDatabase subclass.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
WEAVE_NO_ERROR on success, otherwise return a WEAVE_ERROR indicating a failure to look up a matching ProfileData object.
|
LookupProfileData
virtual WEAVE_ERROR LookupProfileData( uint32_t aProfileId, nl::Weave::TLV::TLVReader *aInstanceIdRdr, ProfileData **aResult )=0
Look up a ProfileData object.
Look up a specific ProfileData object given a profile ID and an (optional) instance ID< provided as a TLV reader.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to find a ProfileData object.
|
Retrieve
WEAVE_ERROR Retrieve( ReferencedTLVData & aPathList, ReferencedTLVData & aDataList )
Retrieve a data list given a path list.
Given a list of paths, retrieve a data list containing data list elements for each path in the path list the data that is the terminal of that path.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR indicating a failure to retrieve the data list of interest.
|
Retrieve
WEAVE_ERROR Retrieve( ReferencedTLVData & aPathList, nl::Weave::TLV::TLVWriter & aWriter )
Write out a data list given a path list.
Given a list of paths and a TLV writer, write out a data list containing data list elements for each path in the path list and the data that is the terminal of that path.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR indicating a failure to retrieve the data or write out the data list of interest.
|
Store
WEAVE_ERROR Store( ReferencedTLVData & aDataList )
Store a data list.
Given a TLV-encoded data list, this method goes through the process of parsing that list and calling the concrete methods provided by ProfileDatabase subclass implementers to put the referenced data where it belongs.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR indicating a failure to store the data of interest.
|
Protected functions
StoreInternal
WEAVE_ERROR StoreInternal( nl::Weave::TLV::TLVReader & aPathReader, uint64_t aVersion, nl::Weave::TLV::TLVReader & aDataReader )