nl::Weave::Profiles::DataManagement_Current::TraitUpdatableDataSink

Summary

Inheritance

Inherits from:
  nl::Weave::Profiles::DataManagement_Current::TraitDataSink
  nl::Weave::Profiles::DataManagement_Current::TraitSchemaEngine::IGetDataDelegate

Constructors and Destructors

TraitUpdatableDataSink(const TraitSchemaEngine *aEngine)

Public functions

ClearUpdated(SubscriptionClient *apSubClient, PropertyPathHandle aPropertyHandle)
GetData(PropertyPathHandle aHandle, uint64_t aTagToWrite, nl::Weave::TLV::TLVWriter & aWriter, bool & aIsNull, bool & aIsPresent) __OVERRIDE
virtual WEAVE_ERROR
Given a path handle to a node, a TLV writer, and booleans indicating whether the value is null or not present, get the data from the trait source that will build a notify.
GetSubscriptionClient() __OVERRIDE
virtual SubscriptionClient *
GetUpdateEncoder() __OVERRIDE
virtual UpdateEncoder *
IsUpdatableDataSink(void) __OVERRIDE
virtual bool
Lock(SubscriptionClient *apSubClient)
void
ReadData(TraitDataHandle aTraitDataHandle, PropertyPathHandle aHandle, uint64_t aTagToWrite, TLV::TLVWriter & aWriter, PropertyPathHandle & aPropertyPathHandleOfDictItemToStartFrom)
SetSubscriptionClient(SubscriptionClient *apSubClient) __OVERRIDE
virtual WEAVE_ERROR
SetUpdateEncoder(UpdateEncoder *apEncoder) __OVERRIDE
virtual WEAVE_ERROR
SetUpdated(SubscriptionClient *apSubClient, PropertyPathHandle aPropertyHandle, bool aIsConditional)
Declares that the given PropertyPathHandle has local modifications.
Unlock(SubscriptionClient *apSubClient)
void

Public functions

ClearUpdated

WEAVE_ERROR ClearUpdated(
  SubscriptionClient *apSubClient,
  PropertyPathHandle aPropertyHandle
)

GetData

virtual WEAVE_ERROR GetData(
  PropertyPathHandle aHandle,
  uint64_t aTagToWrite,
  nl::Weave::TLV::TLVWriter & aWriter,
  bool & aIsNull,
  bool & aIsPresent
) __OVERRIDE

Given a path handle to a node, a TLV writer, and booleans indicating whether the value is null or not present, get the data from the trait source that will build a notify.

If the path handle is not a leaf node, TDM will handle writing values to the writer (like opening containers, nullifying the struct, etc). If a non-leaf node is null or not present, TDM will not call GetData for its children.

This function will only be called for handles that are nullable, optional, ephemeral, or leafs. The expectation is that any traits with handles that have those options enabled will implement appropriate logic to populate aIsNull and aIsPresent.

Details
Parameters
[in] aHandle
The PropertyPathHandle in question.
[in] aTagToWrite
The tag to write for the aHandle.
[in,out] aWriter
The writer to write TLV elements to.
[out] aIsNull
Is aHandle nullified? If yes, TDM will write a null element. If aHandle is not a leaf, TDM will skip over its children.
[out] aIsPresent
Is aHandle present? If no and if aHandle is not a leaf, TDM will skip over the path and its children.
Return Values
WEAVE_NO_ERROR
On success.
other
Was unable to retrieve data and write it into the writer.

GetSubscriptionClient

virtual SubscriptionClient * GetSubscriptionClient() __OVERRIDE

GetUpdateEncoder

virtual UpdateEncoder * GetUpdateEncoder() __OVERRIDE

IsUpdatableDataSink

virtual bool IsUpdatableDataSink(
  void
) __OVERRIDE

Lock

void Lock(
  SubscriptionClient *apSubClient
)

ReadData

WEAVE_ERROR ReadData(
  TraitDataHandle aTraitDataHandle,
  PropertyPathHandle aHandle,
  uint64_t aTagToWrite,
  TLV::TLVWriter & aWriter,
  PropertyPathHandle & aPropertyPathHandleOfDictItemToStartFrom
)

SetSubscriptionClient

virtual WEAVE_ERROR SetSubscriptionClient(
  SubscriptionClient *apSubClient
) __OVERRIDE

SetUpdateEncoder

virtual WEAVE_ERROR SetUpdateEncoder(
  UpdateEncoder *apEncoder
) __OVERRIDE

SetUpdated

WEAVE_ERROR SetUpdated(
  SubscriptionClient *apSubClient,
  PropertyPathHandle aPropertyHandle,
  bool aIsConditional
)

Declares that the given PropertyPathHandle has local modifications.

The NotificationEngine will not override the handle and its descendants until the update request has been processed. The application will receive kEvent_OnUpdateComplete callbacks for this handle or for one of its ancestors with the result of the update operation. The modification can be conditional or not. Conditional data updates will be lost if the local copy of the trait instance is not in sync anymore with publisher's because it was mutated by the publisher itself or by another client. Conditional and unconditional mutations are not supported at the same time in the same trait instance.

Details
Parameters
[in] apSubClient
A pointer to the SubscriptionClient managing this sink.
[in] aPropertyHandle
Any valid PropertyPathHandle for this Trait instance.
[in] aIsConditional
True for a conditional update; false otherwise.
Return Values
WEAVE_NO_ERROR
if the property handle was successfully added to the set of properties to be sent to the owner of the trait.
WEAVE_ERROR_INVALID_ARGUMENT
if the handle or the SubscriptionClient pointer are invalid.
WEAVE_ERROR_WDM_INCONSISTENT_CONDITIONALITY
if the trait instance is already being updated with the opposite conditionality.
WEAVE_ERROR_WDM_LOCAL_DATA_INCONSISTENT
if aIsConditional is true but the trait instance does not have a valid version.
WEAVE_ERROR_WDM_PATH_STORE_FULL
if there is no memory to store the path.
Other
WEAVE_ERROR codes depending on the failure.

TraitUpdatableDataSink

 TraitUpdatableDataSink(
  const TraitSchemaEngine *aEngine
)

Unlock

void Unlock(
  SubscriptionClient *apSubClient
)