class TraitDataSink
Defined at line 577 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
Base abstract class that represents a particular instance of a trait on a specific external resource (client).
Application developers are expected to subclass this to make a concrete sink that ingests data received from publishers.
It takes in a pointer to a schema that it then uses to help decipher incoming TLV data from a publisher and invoke the
relevant data setter calls to pass the data up to subclasses.
Protected Members
const TraitSchemaEngine * mSchemaEngine
Public Methods
void ClearVersion ()
Subclass can invoke this to clear out their version
const TraitSchemaEngine * GetSchemaEngine ()
Defined at line 582 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
uint64_t GetVersion ()
Retrieves the current version of the data that resides in this sink.
Defined at line 608 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
bool IsVersionValid ()
Returns a boolean value that determines whether the version is valid.
Defined at line 612 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
bool IsVersionNewer (DataVersion & aVersion)
Defined at line 614 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
bool AcceptsSubscriptionlessNotifications ()
Returns a boolean value that indicates if this sink accepts
subscriptionless notifications.
Defined at line 621 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
WEAVE_ERROR HandleUnknownLeafHandle ()
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.
Defined at line 629 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
WEAVE_ERROR OnEvent (uint16_t aType, void * aInEventParam)
Invoked either by the base class or by an external agent (like the subscription engine) to signal the occurence of an event
(of type EventType). Sub-classes are expected to over-ride this if they desire to be made known of these events.
Defined at line 723 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
SubscriptionClient * GetSubscriptionClient ()
Defined at line 733 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
UpdateEncoder * GetUpdateEncoder ()
Defined at line 734 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
void TraitDataSink (const TraitSchemaEngine * aEngine)
WEAVE_ERROR StoreDataElement (PropertyPathHandleaHandle,TLV::TLVReader &aReader,uint8_taFlags,OnChangeRejectionaFunc,void *aContext,TraitDataHandleaDatahandle)
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.
void ~TraitDataSink ()
Defined at line 581 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
Protected Methods
uint64_t GetLastNotifyVersion ()
Defined at line 769 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
WEAVE_ERROR SetLeafData (PropertyPathHandle aLeafHandle, nl::Weave::TLV::TLVReader & aReader)
WEAVE_ERROR SetData (PropertyPathHandleaHandle,nl::Weave::TLV::TLVReader &aReader,boolaIsNull)
Defaults to calling SetLeafData if aHandle is a leaf. DataSinks
can optionally implement this if they need to support nullable,
ephemeral, or optional properties.
TODO: make this the defacto API, moving all the logic from
SetLeafData into this function.
void RejectChange (uint16_t aRejectionStatusCode)
Subclass can invoke this if they desire to reject a particular data change
void SetAcceptsSubscriptionlessNotifications (const bool aAcceptsSublessNotifies)
Returns a boolean value that indicates if this sink accepts
subscriptionless notifications.
Defined at line 760 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
void SetVersion (uint64_t version)
Set current version of the data in this sink.
void SetLastNotifyVersion (uint64_t version)
Enumerations
enum ChangeFlags
| Name | Value |
|---|---|
| kFirstElementInChange | (1 << 0) |
| kLastElementInChange | (1 << 1) |
Defined at line 586 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
enum EventType
| Name | Value | Comments |
|---|---|---|
| kEventChangeBegin | 0 |
Signals the beginning of a change record which in certain scenarios can span multiple data elements over multiple |
| kEventDataElementBegin | 1 |
Start of a data element |
| kEventDataElementEnd | 2 |
End of a data element |
| kEventChangeEnd | 3 |
End of a change record |
| kEventDictionaryReplaceBegin | 4 |
Start of replacement of an entire dictionary |
| kEventDictionaryReplaceEnd | 5 |
End of replacement of an entire dictionary |
| kEventDictionaryItemModifyBegin | 6 |
Start of modification or addition of a dictionary item |
| kEventDictionaryItemModifyEnd | 7 |
End of modification or addition of a dictionary item |
| kEventDictionaryItemDelete | 8 |
Deletion of a dictionary item |
| kEventNotifyRequestBegin | 9 |
Signals the start of the processing of a notify packet |
| kEventNotifyRequestEnd | 10 |
Signals the end of the processing of a notify packet |
| kEventViewResponseBegin | 11 |
Signals the start of the processing of a view response |
| kEventViewResponseEnd | 12 |
Signals the end of the processing of a view response |
| kEventSubscriptionTerminated | 13 |
Signals the termination of a subscription either due to an error, or the subscription was cancelled |
Defined at line 638 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/TraitData.h
Records
Friends
class TestTdm