Google is committed to advancing racial equity for Black communities. See how.

nl::Weave::Profiles::DataManagement_Current::GenericTraitCatalogImpl

#include <src/lib/profiles/data-management/Current/GenericTraitCatalogImpl.h>

A Weave provided implementation of the TraitCatalogBase interface for a collection of trait data instances that all refer to the same resource.

Summary

It provides a c++ map-backed storage for these instances.

Inheritance

Inherits from: nl::Weave::Profiles::DataManagement_Current::TraitCatalogBase< T >

Constructors and Destructors

GenericTraitCatalogImpl(void)
~GenericTraitCatalogImpl(void)

Public functions

Add(const ResourceIdentifier & aResourceId, const uint64_t & aInstanceId, PropertyPathHandle basePathHandle, T *traitInstance, TraitDataHandle & aHandle)
AddressToHandle(TLV::TLVReader & aReader, TraitDataHandle & aHandle, SchemaVersionRange & aSchemaVersionRange) const
virtual WEAVE_ERROR
Given a reader positioned at the Path::kCsTag_RootSection structure on a WDM path, parse that structure and return the matching handle to the trait.
Clear(void)
DispatchEvent(uint16_t aEvent, void *aContext) const
virtual WEAVE_ERROR
Dispatch an event to all trait data instance housed in this catalog.
GetInstanceId(TraitDataHandle aHandle, uint64_t & aInstanceId) const
virtual WEAVE_ERROR
GetResourceId(TraitDataHandle aHandle, ResourceIdentifier & aResourceId) const
virtual WEAVE_ERROR
HandleToAddress(TraitDataHandle aHandle, TLV::TLVWriter & aWriter, SchemaVersionRange & aSchemaVersionRange) const
virtual WEAVE_ERROR
Given a trait handle, write out the TLV for the Path::kCsTag_RootSection structure.
Iterate(IteratorCallback aCallback, void *aContext)
virtual void
Locate(TraitDataHandle aHandle, T **aTraitInstance) const
virtual WEAVE_ERROR
Given a handle, return a reference to the matching trait data instance.
Locate(T *aTraitInstance, TraitDataHandle & aHandle) const
virtual WEAVE_ERROR
Reverse.
Locate(uint32_t aProfileId, uint64_t aInstanceId, ResourceIdentifier aResourceId, TraitDataHandle & aHandle) const
Locate(uint32_t aProfileId, uint64_t aInstanceId, ResourceIdentifier aResourceId, T **aTraitInstance) const
PrepareSubscriptionPathList(TraitPath *pathList, uint16_t pathListSize, uint16_t & pathListLen)
PrepareSubscriptionSpecificPathList(TraitPath *pathList, uint16_t pathListSize, TraitDataHandle aHandle)
Remove(T *traitInstance)
Remove(TraitDataHandle aHandle)
SetNodeId(uint64_t aNodeId)
void
Size(void) const
uint32_t
Return the number of trait instances in the catalog.

Public functions

Add

WEAVE_ERROR Add(
  const ResourceIdentifier & aResourceId,
  const uint64_t & aInstanceId,
  PropertyPathHandle basePathHandle,
  T *traitInstance,
  TraitDataHandle & aHandle
)

AddressToHandle

virtual WEAVE_ERROR AddressToHandle(
  TLV::TLVReader & aReader,
  TraitDataHandle & aHandle,
  SchemaVersionRange & aSchemaVersionRange
) const 

Given a reader positioned at the Path::kCsTag_RootSection structure on a WDM path, parse that structure and return the matching handle to the trait.

Clear

WEAVE_ERROR Clear(
  void
)

DispatchEvent

virtual WEAVE_ERROR DispatchEvent(
  uint16_t aEvent,
  void *aContext
) const 

Dispatch an event to all trait data instance housed in this catalog.

GenericTraitCatalogImpl

 GenericTraitCatalogImpl(
  void
)

GetInstanceId

virtual WEAVE_ERROR GetInstanceId(
  TraitDataHandle aHandle,
  uint64_t & aInstanceId
) const 

GetResourceId

virtual WEAVE_ERROR GetResourceId(
  TraitDataHandle aHandle,
  ResourceIdentifier & aResourceId
) const 

HandleToAddress

virtual WEAVE_ERROR HandleToAddress(
  TraitDataHandle aHandle,
  TLV::TLVWriter & aWriter,
  SchemaVersionRange & aSchemaVersionRange
) const 

Given a trait handle, write out the TLV for the Path::kCsTag_RootSection structure.

Iterate

virtual void Iterate(
  IteratorCallback aCallback,
  void *aContext
)

Locate

virtual WEAVE_ERROR Locate(
  TraitDataHandle aHandle,
  T **aTraitInstance
) const 

Given a handle, return a reference to the matching trait data instance.

Locate

virtual WEAVE_ERROR Locate(
  T *aTraitInstance,
  TraitDataHandle & aHandle
) const 

Reverse.

Locate

WEAVE_ERROR Locate(
  uint32_t aProfileId,
  uint64_t aInstanceId,
  ResourceIdentifier aResourceId,
  TraitDataHandle & aHandle
) const 

Locate

WEAVE_ERROR Locate(
  uint32_t aProfileId,
  uint64_t aInstanceId,
  ResourceIdentifier aResourceId,
  T **aTraitInstance
) const 

PrepareSubscriptionPathList

WEAVE_ERROR PrepareSubscriptionPathList(
  TraitPath *pathList,
  uint16_t pathListSize,
  uint16_t & pathListLen
)

PrepareSubscriptionSpecificPathList

WEAVE_ERROR PrepareSubscriptionSpecificPathList(
  TraitPath *pathList,
  uint16_t pathListSize,
  TraitDataHandle aHandle
)

Remove

WEAVE_ERROR Remove(
  T *traitInstance
)

Remove

WEAVE_ERROR Remove(
  TraitDataHandle aHandle
)

SetNodeId

void SetNodeId(
  uint64_t aNodeId
)

Size

uint32_t Size(
  void
) const 

Return the number of trait instances in the catalog.

~GenericTraitCatalogImpl

virtual  ~GenericTraitCatalogImpl(
  void
)