nl::Weave::Profiles::DataManagement_Legacy::ProfileDatabase::ProfileData

This is an abstract class.

#include <src/lib/profiles/data-management/Legacy/ProfileDatabase.h>

The abstract ProfileData auxiliary inner class.

Summary

ProfileDatabase sub-class implementers should implement sub-classes of this auxiliary inner class as well. The function of ProfileData objects is to provide hooks whereby concrete data may be stored, given a its representation as TLV and retrieved as a TLV representation given a TLV-encoded list of paths.

Constructors and Destructors

ProfileData(void)
The default constructor for ProfileData.
~ProfileData(void)
The destructor for ProfileData.

Public attributes

mVersion
uint64_t
Profile data version.

Public functions

Retrieve(nl::Weave::TLV::TLVReader & aPathReader, nl::Weave::TLV::TLVWriter & aDataWriter)=0
virtual WEAVE_ERROR
Write out a data item given a residual WDM path.
Store(nl::Weave::TLV::TLVReader & aPathReader, uint64_t aVersion, nl::Weave::TLV::TLVReader & aDataReader)
virtual WEAVE_ERROR
Store a data list item being read.
StoreItem(const uint64_t & aTag, nl::Weave::TLV::TLVReader & aDataReader)=0
virtual WEAVE_ERROR
Store a data item based on its tag.

Public attributes

mVersion

uint64_t mVersion

Profile data version.

The version given here in the ProfileData object applies to the whole profile data set for a particular instance.

Public functions

ProfileData

 ProfileData(
  void
)

The default constructor for ProfileData.

Initialize a fresh ProfileData item by setting its version to 0.

Retrieve

virtual WEAVE_ERROR Retrieve(
  nl::Weave::TLV::TLVReader & aPathReader,
  nl::Weave::TLV::TLVWriter & aDataWriter
)=0

Write out a data item given a residual WDM path.

ProfileDatabase subclass implementers must provide a concrete implementation for this method in every case where the individual elements of a ProfileData subclass object are accessible under particular tags.

Details
Parameters
[in] aPathReader
A reference to a TLV reader positioned in a WDM path after the profile information, i.e. at the 'residual' path elements if any.
[in] aDataWriter
A reference to a TLV writer used to write out the data indicated by the residual path.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to recognize a residual tag or else to write the corresponding data.

Store

virtual WEAVE_ERROR Store(
  nl::Weave::TLV::TLVReader & aPathReader,
  uint64_t aVersion,
  nl::Weave::TLV::TLVReader & aDataReader
)

Store a data list item being read.

This virtual method is used to store a particular data list item in an object of a concrete ProfileData subclass. The implementation here in the super-class may be used if the object is simple and "shallow", having only paths that are one element long. For a more complicated schema, implementers should override this method.

Details
Parameters
[in] aPathReader
A reference to a TLV reader positioned at the path component of the data list item.
[in] aVersion
The 64-bit version component of the data list item.
[in] aDataReader
A reference to a TLV reader positioned at the data component of the data list item.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR indicating a failure to store the data of interest.

StoreItem

virtual WEAVE_ERROR StoreItem(
  const uint64_t & aTag,
  nl::Weave::TLV::TLVReader & aDataReader
)=0

Store a data item based on its tag.

Details
Parameters
[in] aTag
A reference to the fully-qualified 64-bit TLV tag under which the data should be stored.
[in] aDataReader
A TLV reader positioned at the data item to be stored.
Returns
WEAVE_NO_ERROR on success, otherwise return a WEAVE_ERROR reflecting an inability either to recognize the tag or to store the data.

~ProfileData

virtual  ~ProfileData(
  void
)

The destructor for ProfileData.

Like the constructor this just clears the data verion to 0.