nl::Weave::Profiles::DataManagement_Current::TraitPathStore

Summary

Constructors and Destructors

TraitPathStore()
Empty constructor.

Public types

@142{
  kFlag_Failed = 0x2
}
enum
Flags typedef
uint8_t

Public attributes

mStore
Record *

Public functions

AddItem(const TraitPath & aItem)
Adds a TraitPath to the store.
AddItem(const TraitPath & aItem, Flags aFlags)
Adds a TraitPath to the store with a given set of flags.
AddItemDedup(const TraitPath & aItem, const TraitSchemaEngine *const aSchemaEngine)
AreFlagsSet(size_t aIndex, Flags aFlags) const
bool
Clear()
void
Empties the store.
Compact()
void
Compacts the store moving all items in use down towards the start of the array.
GetFirstValidItem() const
size_t
GetFirstValidItem(TraitDataHandle aTraitDataHandle) const
size_t
GetItemAt(size_t aIndex, TraitPath & aTraitPath)
void
GetNextValidItem(size_t i) const
size_t
GetNextValidItem(size_t i, TraitDataHandle aTraitDataHandle) const
size_t
GetNumItems()
size_t
GetPathStoreSize()
size_t
Includes(const TraitPath & aItem, const TraitSchemaEngine *const aSchemaEngine) const
bool
Check if any of the TraitPaths in the store includes a given TraitPath.
Init(Record *aRecordArray, size_t aNumItems)
void
Inits the TraitPathStore.
InsertItemAfter(size_t aIndex, const TraitPath & aItem, Flags aFlags)
InsertItemAt(size_t aIndex, const TraitPath & aItem, Flags aFlags)
Adds an TraitPath to the store, inserting it at a given index.
Intersects(const TraitPath & aItem, const TraitSchemaEngine *const aSchemaEngine) const
bool
Check if any of the TraitPaths in the store intersects a given TraitPath.
IsEmpty()
bool
IsFull()
bool
IsItemFailed(size_t aIndex) const
bool
IsItemInUse(size_t aIndex) const
bool
IsItemValid(size_t aIndex) const
bool
IsPresent(const TraitPath & aItem) const
bool
Checks if a given TraitPath is already in the store.
IsTraitPresent(TraitDataHandle aDataHandle) const
bool
RemoveItemAt(size_t aIndex)
void
RemoveTrait(TraitDataHandle aDataHandle)
void
Remove all TraitPaths that refer to a given TraitDataHandle.
SetFailed(size_t aIndex)
void
SetFailed()
void
Mark all TraitPaths as failed.
SetFailedTrait(TraitDataHandle aDataHandle)
void
Mark all TraitPaths referring to the given TraitDataHandle as failed.

Structs

nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Record

Public types

@142

 nl::Weave::Profiles::DataManagement_Current::TraitPathStore::@142
Properties
kFlag_Failed

The item is in use, but is not valid anymore.

Flags

uint8_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Flags

Public attributes

mStore

Record * nl::Weave::Profiles::DataManagement_Current::TraitPathStore::mStore

Public functions

AddItem

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::TraitPathStore::AddItem(
  const TraitPath & aItem
)

Adds a TraitPath to the store.

Details
Parameters
[in] aItem
The TraitPath to be stored
Return Values
WEAVE_NO_ERROR
in case of success.
WEAVE_ERROR_WDM_PATH_STORE_FULL
if the store is full.

AddItem

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::TraitPathStore::AddItem(
  const TraitPath & aItem,
  Flags aFlags
)

Adds a TraitPath to the store with a given set of flags.

Details
Parameters
[in] aItem
The TraitPath to be stored
[in] aFlags
The flags to be set to true for the item being added
Return Values
WEAVE_NO_ERROR
in case of success.
WEAVE_ERROR_WDM_PATH_STORE_FULL
if the store is full.
WEAVE_ERROR_INVALID_ARGUMENT
if aFlags contains reserved flags

AddItemDedup

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::TraitPathStore::AddItemDedup(
  const TraitPath & aItem,
  const TraitSchemaEngine *const aSchemaEngine
)

AreFlagsSet

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::AreFlagsSet(
  size_t aIndex,
  Flags aFlags
) const 

Clear

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Clear()

Empties the store.

Compact

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Compact()

Compacts the store moving all items in use down towards the start of the array.

This is useful to use TraitPathStore to implement a list that can be edited (like the list of in-progress paths maintained by SubscriptionClient).

GetFirstValidItem

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetFirstValidItem() const 

GetFirstValidItem

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetFirstValidItem(
  TraitDataHandle aTraitDataHandle
) const 

GetItemAt

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetItemAt(
  size_t aIndex,
  TraitPath & aTraitPath
)

GetNextValidItem

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetNextValidItem(
  size_t i
) const 

GetNextValidItem

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetNextValidItem(
  size_t i,
  TraitDataHandle aTraitDataHandle
) const 

GetNumItems

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetNumItems()

Details
Returns
Returns the number of TraitPaths in the store.

GetPathStoreSize

size_t nl::Weave::Profiles::DataManagement_Current::TraitPathStore::GetPathStoreSize()

Details
Returns
Returns the capacity of the store.

Includes

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Includes(
  const TraitPath & aItem,
  const TraitSchemaEngine *const aSchemaEngine
) const 

Check if any of the TraitPaths in the store includes a given TraitPath.

TraitPath A includes TraitPath B if either:

  • the two TraitPaths are the same;
  • A is an ancestor of B.

Details
Parameters
[in] aTraitPath
The TraitPath to be checked against the store.
[in] aSchemaEngine
A pointer to the TraitSchemaEngine for the trait instance aTraitPath refers to.
Returns
true if the TraitPath is already included by the paths in the store.

Init

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Init(
  Record *aRecordArray,
  size_t aNumItems
)

Inits the TraitPathStore.

Details
Parameters
[in] aRecordArray
Pointer to an array of Records that will be used to store paths and flags.
[in] aArrayLength
Length of the storage array in number of items.

InsertItemAfter

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::TraitPathStore::InsertItemAfter(
  size_t aIndex,
  const TraitPath & aItem,
  Flags aFlags
)

InsertItemAt

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::TraitPathStore::InsertItemAt(
  size_t aIndex,
  const TraitPath & aItem,
  Flags aFlags
)

Adds an TraitPath to the store, inserting it at a given index.

Assumes the store has no gaps.

Details
Parameters
[in] aIndex
The index at which to insert the TraitPath; the insertion has to keep the store compacted.
[in] aFlags
The flags to be set to true for the item being added.
Return Values
WEAVE_ERROR_INCORRECT_STATE
if the store has gaps.
WEAVE_ERROR_INVALID_ARGUMENT
if adding the TraitPath at aIndex would make the store not compact.
WEAVE_ERROR_WDM_PATH_STORE_FULL
if the store is full.
WEAVE_NO_ERROR
in case of success.

Intersects

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::Intersects(
  const TraitPath & aItem,
  const TraitSchemaEngine *const aSchemaEngine
) const 

Check if any of the TraitPaths in the store intersects a given TraitPath.

Two TraitPaths intersect each other if any of the following is true:

  • the two TraitPaths are the same;
  • one of the two TraitPaths is an ancestor of the other TraitPath.

Details
Parameters
[in] aTraitPath
The TraitPath to be checked against the store.
[in] aSchemaEngine
A pointer to the TraitSchemaEngine for the trait instance aTraitPath refers to.
Returns
true if the store intersects the given TraitPath; false otherwise.

IsEmpty

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsEmpty()

Details
Returns
Returns true if the store is empty; false otherwise.

IsFull

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsFull()

Details
Returns
Returns true if the store is full; false otherwise.

IsItemFailed

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsItemFailed(
  size_t aIndex
) const 

IsItemInUse

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsItemInUse(
  size_t aIndex
) const 

IsItemValid

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsItemValid(
  size_t aIndex
) const 

IsPresent

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsPresent(
  const TraitPath & aItem
) const 

Checks if a given TraitPath is already in the store.

Details
Parameters
[in] aItem
The TraitPath to look for.
Returns
Returns true if the store contains aItem.

IsTraitPresent

bool nl::Weave::Profiles::DataManagement_Current::TraitPathStore::IsTraitPresent(
  TraitDataHandle aDataHandle
) const 

Details
Parameters
[in] aDataHandle
The TraitDataHandle to look for.
Returns
Returns true if the store contains one or more paths referring to the given TraitDataHandle

RemoveItemAt

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::RemoveItemAt(
  size_t aIndex
)

RemoveTrait

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::RemoveTrait(
  TraitDataHandle aDataHandle
)

Remove all TraitPaths that refer to a given TraitDataHandle.

Details
Parameters
[in] aDataHandle
The TraitDataHandle

SetFailed

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::SetFailed(
  size_t aIndex
)

SetFailed

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::SetFailed()

Mark all TraitPaths as failed.

SetFailedTrait

void nl::Weave::Profiles::DataManagement_Current::TraitPathStore::SetFailedTrait(
  TraitDataHandle aDataHandle
)

Mark all TraitPaths referring to the given TraitDataHandle as failed.

Details
Parameters
aDataHandle
The TraitDataHandle to look for.

TraitPathStore

 nl::Weave::Profiles::DataManagement_Current::TraitPathStore::TraitPathStore()

Empty constructor.