nl::Weave::Profiles::DataManagement_Current::TraitDataSink

This is an abstract class.

Summary

Inheritance

Inherits from: nl::Weave::Profiles::DataManagement_Current::TraitSchemaEngine::ISetDataDelegate

Constructors and Destructors

TraitDataSink(const TraitSchemaEngine *aEngine)
~TraitDataSink()

Public types

ChangeFlags enum
EventType enum
OnChangeRejection)(uint16_t aRejectionStatusCode, uint64_t aVersion, void *aContext) typedef

Protected attributes

mSchemaEngine

Public functions

ClearVersion(void)
void
GetSchemaEngine(void) const
GetSubscriptionClient()
virtual SubscriptionClient *
GetVersion(void) const
uint64_t
Retrieves the current version of the data that resides in this sink.
HandleUnknownLeafHandle(void)
Convenience function for data sinks to handle unknown leaf handles with a system level tolerance for mismatched schema as defined by TDM_DISABLE_STRICT_SCHEMA_COMPILANCE.
IsVersionValid(void) const
bool
Returns a boolean value that determines whether the version is valid.
OnEvent(uint16_t aType, void *aInEventParam)
virtual WEAVE_ERROR
StoreDataElement(PropertyPathHandle aHandle, TLV::TLVReader & aReader, uint8_t aFlags, OnChangeRejection aFunc, void *aContext, TraitDataHandle aDatahandle)
Given a reader that points to a data element conformant to a schema bound to this object, this method processes that data and invokes the relevant SetLeafData call below for all leaf items in the buffer.

Protected functions

RejectChange(uint16_t aRejectionStatusCode)
void
SetData(PropertyPathHandle aHandle, nl::Weave::TLV::TLVReader & aReader, bool aIsNull) __OVERRIDE
virtual WEAVE_ERROR
Given a path handle to a node, a TLV reader, and an indication of whether a null type was received, set the data in the callee.
SetLeafData(PropertyPathHandle aLeafHandle, nl::Weave::TLV::TLVReader & aReader) __OVERRIDE=0
virtual WEAVE_ERROR
Given a path handle to a leaf node and a TLV reader, set the leaf data in the callee.

Unions

nl::Weave::Profiles::DataManagement_Current::TraitDataSink::InEventParam

Public types

ChangeFlags

 ChangeFlags

EventType

 EventType

OnChangeRejection

WEAVE_ERROR(* OnChangeRejection)(uint16_t aRejectionStatusCode, uint64_t aVersion, void *aContext)

Protected attributes

mSchemaEngine

const TraitSchemaEngine * mSchemaEngine

Public functions

ClearVersion

void ClearVersion(
  void
)

GetSchemaEngine

const TraitSchemaEngine * GetSchemaEngine(
  void
) const 

GetSubscriptionClient

virtual SubscriptionClient * GetSubscriptionClient()

GetVersion

uint64_t GetVersion(
  void
) const 

Retrieves the current version of the data that resides in this sink.

HandleUnknownLeafHandle

WEAVE_ERROR HandleUnknownLeafHandle(
  void
)

Convenience function for data sinks to handle unknown leaf handles with a system level tolerance for mismatched schema as defined by TDM_DISABLE_STRICT_SCHEMA_COMPILANCE.

IsVersionValid

bool IsVersionValid(
  void
) const 

Returns a boolean value that determines whether the version is valid.

OnEvent

virtual WEAVE_ERROR OnEvent(
  uint16_t aType,
  void *aInEventParam
)

StoreDataElement

WEAVE_ERROR StoreDataElement(
  PropertyPathHandle aHandle,
  TLV::TLVReader & aReader,
  uint8_t aFlags,
  OnChangeRejection aFunc,
  void *aContext,
  TraitDataHandle aDatahandle
)

Given a reader that points to a data element conformant to a schema bound to this object, this method processes that data and invokes the relevant SetLeafData call below for all leaf items in the buffer.

A change rejection function can be passed in as well that will be invoked if the sink chooses to reject this data for any reason.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Encountered errors writing out the data.

TraitDataSink

 TraitDataSink(
  const TraitSchemaEngine *aEngine
)

~TraitDataSink

virtual  ~TraitDataSink()

Protected functions

RejectChange

void RejectChange(
  uint16_t aRejectionStatusCode
)

SetData

virtual WEAVE_ERROR SetData(
  PropertyPathHandle aHandle,
  nl::Weave::TLV::TLVReader & aReader,
  bool aIsNull
) __OVERRIDE

Given a path handle to a node, a TLV reader, and an indication of whether a null type was received, set the data in the callee.

TDM will only call this function for handles that are nullable, optional, ephemeral, or leafs. If aHandle is a non-leaf node and is nullified, TDM will not call SetData for its children.

Details
Parameters
[in] aHandle
The PropertyPathHandle in question.
[in,out] aReader
The TLV reader to read from.
[out] aIsNull
Is aHandle nullified?
Return Values
WEAVE_NO_ERROR
On success.
other
Was unable to read out data from the reader.

SetLeafData

virtual WEAVE_ERROR SetLeafData(
  PropertyPathHandle aLeafHandle,
  nl::Weave::TLV::TLVReader & aReader
) __OVERRIDE=0

Given a path handle to a leaf node and a TLV reader, set the leaf data in the callee.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Was unable to read out data from the reader.