Skip to content

Commit 8edc026

Browse files
committed
Rename AttributePathExpandIterator to legacy
1 parent 222d5fc commit 8edc026

5 files changed

+21
-21
lines changed

src/app/AttributePathExpandIterator.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace chip::app::DataModel;
2424
namespace chip {
2525
namespace app {
2626

27-
AttributePathExpandIterator::AttributePathExpandIterator(DataModel::Provider * provider,
27+
AttributePathExpandIteratorLegacy::AttributePathExpandIteratorLegacy(DataModel::Provider * provider,
2828
SingleLinkedListNode<AttributePathParams> * attributePath) :
2929
mDataModelProvider(provider), mpAttributePath(attributePath),
3030
mOutputPath(kInvalidEndpointId, kInvalidClusterId, kInvalidAttributeId)
@@ -37,7 +37,7 @@ AttributePathExpandIterator::AttributePathExpandIterator(DataModel::Provider * p
3737
Next();
3838
}
3939

40-
bool AttributePathExpandIterator::IsValidAttributeId(AttributeId attributeId)
40+
bool AttributePathExpandIteratorLegacy::IsValidAttributeId(AttributeId attributeId)
4141
{
4242
switch (attributeId)
4343
{
@@ -53,7 +53,7 @@ bool AttributePathExpandIterator::IsValidAttributeId(AttributeId attributeId)
5353
return mDataModelProvider->GetAttributeInfo(attributePath).has_value();
5454
}
5555

56-
std::optional<AttributeId> AttributePathExpandIterator::NextAttributeId()
56+
std::optional<AttributeId> AttributePathExpandIteratorLegacy::NextAttributeId()
5757
{
5858
if (mOutputPath.mAttributeId == kInvalidAttributeId)
5959
{
@@ -108,7 +108,7 @@ std::optional<AttributeId> AttributePathExpandIterator::NextAttributeId()
108108
return GlobalAttributesNotInMetadata[0];
109109
}
110110

111-
std::optional<ClusterId> AttributePathExpandIterator::NextClusterId()
111+
std::optional<ClusterId> AttributePathExpandIteratorLegacy::NextClusterId()
112112
{
113113

114114
if (mOutputPath.mClusterId == kInvalidClusterId)
@@ -135,7 +135,7 @@ std::optional<ClusterId> AttributePathExpandIterator::NextClusterId()
135135
return entry.IsValid() ? std::make_optional(entry.path.mClusterId) : std::nullopt;
136136
}
137137

138-
std::optional<ClusterId> AttributePathExpandIterator::NextEndpointId()
138+
std::optional<ClusterId> AttributePathExpandIteratorLegacy::NextEndpointId()
139139
{
140140
if (mOutputPath.mEndpointId == kInvalidEndpointId)
141141
{
@@ -154,7 +154,7 @@ std::optional<ClusterId> AttributePathExpandIterator::NextEndpointId()
154154
return (ep.id != kInvalidEndpointId) ? std::make_optional(ep.id) : std::nullopt;
155155
}
156156

157-
void AttributePathExpandIterator::ResetCurrentCluster()
157+
void AttributePathExpandIteratorLegacy::ResetCurrentCluster()
158158
{
159159
// If this is a null iterator, or the attribute id of current cluster info is not a wildcard attribute id, then this function
160160
// will do nothing, since we won't be expanding the wildcard attribute ids under a cluster.
@@ -165,7 +165,7 @@ void AttributePathExpandIterator::ResetCurrentCluster()
165165
mOutputPath.mExpanded = true; // we know this is a wildcard attribute
166166
Next();
167167
}
168-
bool AttributePathExpandIterator::AdvanceOutputPath()
168+
bool AttributePathExpandIteratorLegacy::AdvanceOutputPath()
169169
{
170170
if (!mpAttributePath->mValue.IsWildcardPath())
171171
{
@@ -218,7 +218,7 @@ bool AttributePathExpandIterator::AdvanceOutputPath()
218218
}
219219
}
220220

221-
bool AttributePathExpandIterator::Next()
221+
bool AttributePathExpandIteratorLegacy::Next()
222222
{
223223
while (mpAttributePath != nullptr)
224224
{

src/app/AttributePathExpandIterator.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ class AttributePathExpandIterator2
184184
* TODO: The AttributePathParams may support a group id, the iterator should be able to call group data provider to expand the group
185185
* id.
186186
*/
187-
class AttributePathExpandIterator
187+
class AttributePathExpandIteratorLegacy
188188
{
189189
public:
190-
AttributePathExpandIterator(DataModel::Provider * provider, SingleLinkedListNode<AttributePathParams> * attributePath);
190+
AttributePathExpandIteratorLegacy(DataModel::Provider * provider, SingleLinkedListNode<AttributePathParams> * attributePath);
191191

192192
/**
193193
* Proceed the iterator to the next attribute path in the given cluster info.
@@ -218,7 +218,7 @@ class AttributePathExpandIterator
218218
/** Start iterating over the given `paths` */
219219
inline void ResetTo(SingleLinkedListNode<AttributePathParams> * paths)
220220
{
221-
*this = AttributePathExpandIterator(mDataModelProvider, paths);
221+
*this = AttributePathExpandIteratorLegacy(mDataModelProvider, paths);
222222
}
223223

224224
private:

src/app/InteractionModelEngine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ CHIP_ERROR InteractionModelEngine::ParseAttributePaths(const Access::SubjectDesc
582582

583583
if (paramsList.mValue.IsWildcardPath())
584584
{
585-
AttributePathExpandIterator pathIterator(GetDataModelProvider(), &paramsList);
585+
AttributePathExpandIteratorLegacy pathIterator(GetDataModelProvider(), &paramsList);
586586
ConcreteAttributePath readPath;
587587

588588
// The definition of "valid path" is "path exists and ACL allows access". The "path exists" part is handled by

src/app/ReadHandler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class ReadHandler : public Messaging::ExchangeDelegate
407407
bool IsFabricFiltered() const { return mFlags.Has(ReadHandlerFlags::FabricFiltered); }
408408
CHIP_ERROR OnSubscribeRequest(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload);
409409
void GetSubscriptionId(SubscriptionId & aSubscriptionId) const { aSubscriptionId = mSubscriptionId; }
410-
AttributePathExpandIterator * GetAttributePathExpandIterator() { return &mAttributePathExpandIterator; }
410+
AttributePathExpandIteratorLegacy * GetAttributePathExpandIterator() { return &mAttributePathExpandIterator; }
411411

412412
/// @brief Notifies the read handler that a set of attribute paths has been marked dirty. This will schedule a reporting engine
413413
/// run if the change to the attribute path makes the ReadHandler reportable.
@@ -519,7 +519,7 @@ class ReadHandler : public Messaging::ExchangeDelegate
519519
/// @param aFlag Flag to clear
520520
void ClearStateFlag(ReadHandlerFlags aFlag);
521521

522-
AttributePathExpandIterator mAttributePathExpandIterator;
522+
AttributePathExpandIteratorLegacy mAttributePathExpandIterator;
523523

524524
// The current generation of the reporting engine dirty set the last time we were notified that a path we're interested in was
525525
// marked dirty.

src/app/tests/TestAttributePathExpandIterator.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ TEST(TestAttributePathExpandIterator, TestAllWildcard)
106106

107107
size_t index = 0;
108108

109-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
109+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
110110
iter.Next())
111111
{
112112
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -131,7 +131,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardEndpoint)
131131

132132
size_t index = 0;
133133

134-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
134+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
135135
iter.Next())
136136
{
137137
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -159,7 +159,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardCluster)
159159

160160
size_t index = 0;
161161

162-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
162+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
163163
iter.Next())
164164
{
165165
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -187,7 +187,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardClusterGlobalAttributeNotInMet
187187

188188
size_t index = 0;
189189

190-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
190+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
191191
iter.Next())
192192
{
193193
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -219,7 +219,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardAttribute)
219219

220220
size_t index = 0;
221221

222-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
222+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
223223
iter.Next())
224224
{
225225
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -245,7 +245,7 @@ TEST(TestAttributePathExpandIterator, TestNoWildcard)
245245

246246
size_t index = 0;
247247

248-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
248+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo); iter.Get(path);
249249
iter.Next())
250250
{
251251
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,
@@ -360,7 +360,7 @@ TEST(TestAttributePathExpandIterator, TestMultipleClusInfo)
360360

361361
size_t index = 0;
362362

363-
for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo1);
363+
for (app::AttributePathExpandIteratorLegacy iter(CodegenDataModelProviderInstance(nullptr /* delegate */), &clusInfo1);
364364
iter.Get(path); iter.Next())
365365
{
366366
ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId,

0 commit comments

Comments
 (0)