template <typename T>

class SingleResourceTraitCatalog

Defined at line 44 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SingleResourceTraitCatalog.h

A Weave provided implementation of the TraitCatalogBase interface for a collection of trait data instances

that all refer to the same resource. It provides an array-backed, bounded storage for these instances.

Public Methods

void SingleResourceTraitCatalog<T> (ResourceIdentifier aResourceIdentifier, CatalogItem * aCatalogStore, uint32_t aNumMaxCatalogItems)

Instances a trait catalog given a pointer to the underlying array store.

WEAVE_ERROR Add (uint64_t aInstanceId, T * aItem, TraitDataHandle & aHandle)

Add a new trait data instance into the catalog and return a handle to it.

WEAVE_ERROR AddAt (uint64_t aInstanceId, T * aItem, TraitDataHandle aHandle)

Add a new trait data instance bound to a user-selected trait handle (which in this particular implementation, denotes the

offset in the array). The handle is to be between 0 and the size of the array. Also, the caller should ensure no gaps form

after every call made to this method.

WEAVE_ERROR Remove (TraitDataHandle aHandle)

Removes a trait instance from the catalog.

WEAVE_ERROR Locate (uint64_t aProfileId, uint64_t aInstanceId, TraitDataHandle & aHandle)
uint32_t Count ()

Return the number of trait instances in the catalog.

WEAVE_ERROR AddressToHandle (TLV::TLVReader & aReader, TraitDataHandle & aHandle, SchemaVersionRange & aSchemaVersionRange)
WEAVE_ERROR HandleToAddress (TraitDataHandle aHandle, TLV::TLVWriter & aWriter, SchemaVersionRange & aSchemaVersionRange)
WEAVE_ERROR Locate (TraitDataHandle aHandle, T ** aTraitInstance)
WEAVE_ERROR Locate (T * aTraitInstance, TraitDataHandle & aHandle)
WEAVE_ERROR DispatchEvent (uint16_t aEvent, void * aContext)
void Iterate (IteratorCallback aCallback, void * aContext)

Records