18
18
#include < app/AttributePathExpandIterator-DataModel.h>
19
19
#include < app/GlobalAttributes.h>
20
20
21
- using namespace chip ::app::InteractionModel ;
21
+ using namespace chip ::app::DataModel ;
22
22
23
23
namespace chip {
24
24
namespace app {
25
25
26
26
AttributePathExpandIteratorDataModel::AttributePathExpandIteratorDataModel (
27
- InteractionModel::DataModel * dataModel , SingleLinkedListNode<AttributePathParams> * attributePath) :
28
- mDataModel (dataModel ),
27
+ DataModel::Provider * provider , SingleLinkedListNode<AttributePathParams> * attributePath) :
28
+ mDataModelProvider (provider ),
29
29
mpAttributePath (attributePath), mOutputPath (kInvalidEndpointId , kInvalidClusterId , kInvalidAttributeId )
30
30
31
31
{
@@ -52,7 +52,7 @@ bool AttributePathExpandIteratorDataModel::IsValidAttributeId(AttributeId attrib
52
52
}
53
53
54
54
const ConcreteAttributePath attributePath (mOutputPath .mEndpointId , mOutputPath .mClusterId , attributeId);
55
- return mDataModel ->GetAttributeInfo (attributePath).has_value ();
55
+ return mDataModelProvider ->GetAttributeInfo (attributePath).has_value ();
56
56
}
57
57
58
58
std::optional<AttributeId> AttributePathExpandIteratorDataModel::NextAttributeId ()
@@ -61,7 +61,7 @@ std::optional<AttributeId> AttributePathExpandIteratorDataModel::NextAttributeId
61
61
{
62
62
if (mpAttributePath->mValue .HasWildcardAttributeId ())
63
63
{
64
- AttributeEntry entry = mDataModel ->FirstAttribute (mOutputPath );
64
+ AttributeEntry entry = mDataModelProvider ->FirstAttribute (mOutputPath );
65
65
return entry.IsValid () //
66
66
? entry.path .mAttributeId //
67
67
: Clusters::Globals::Attributes::GeneratedCommandList::Id; //
@@ -99,7 +99,7 @@ std::optional<AttributeId> AttributePathExpandIteratorDataModel::NextAttributeId
99
99
return std::nullopt;
100
100
}
101
101
102
- AttributeEntry entry = mDataModel ->NextAttribute (mOutputPath );
102
+ AttributeEntry entry = mDataModelProvider ->NextAttribute (mOutputPath );
103
103
if (entry.IsValid ())
104
104
{
105
105
return entry.path .mAttributeId ;
@@ -117,13 +117,13 @@ std::optional<ClusterId> AttributePathExpandIteratorDataModel::NextClusterId()
117
117
{
118
118
if (mpAttributePath->mValue .HasWildcardClusterId ())
119
119
{
120
- ClusterEntry entry = mDataModel ->FirstCluster (mOutputPath .mEndpointId );
120
+ ClusterEntry entry = mDataModelProvider ->FirstCluster (mOutputPath .mEndpointId );
121
121
return entry.IsValid () ? std::make_optional (entry.path .mClusterId ) : std::nullopt;
122
122
}
123
123
124
124
// only return a cluster if it is valid
125
125
const ConcreteClusterPath clusterPath (mOutputPath .mEndpointId , mpAttributePath->mValue .mClusterId );
126
- if (!mDataModel ->GetClusterInfo (clusterPath).has_value ())
126
+ if (!mDataModelProvider ->GetClusterInfo (clusterPath).has_value ())
127
127
{
128
128
return std::nullopt;
129
129
}
@@ -133,7 +133,7 @@ std::optional<ClusterId> AttributePathExpandIteratorDataModel::NextClusterId()
133
133
134
134
VerifyOrReturnValue (mpAttributePath->mValue .HasWildcardClusterId (), std::nullopt);
135
135
136
- ClusterEntry entry = mDataModel ->NextCluster (mOutputPath );
136
+ ClusterEntry entry = mDataModelProvider ->NextCluster (mOutputPath );
137
137
return entry.IsValid () ? std::make_optional (entry.path .mClusterId ) : std::nullopt;
138
138
}
139
139
@@ -143,7 +143,7 @@ std::optional<ClusterId> AttributePathExpandIteratorDataModel::NextEndpointId()
143
143
{
144
144
if (mpAttributePath->mValue .HasWildcardEndpointId ())
145
145
{
146
- EndpointId id = mDataModel ->FirstEndpoint ();
146
+ EndpointId id = mDataModelProvider ->FirstEndpoint ();
147
147
return (id != kInvalidEndpointId ) ? std::make_optional (id) : std::nullopt;
148
148
}
149
149
@@ -152,7 +152,7 @@ std::optional<ClusterId> AttributePathExpandIteratorDataModel::NextEndpointId()
152
152
153
153
VerifyOrReturnValue (mpAttributePath->mValue .HasWildcardEndpointId (), std::nullopt);
154
154
155
- EndpointId id = mDataModel ->NextEndpoint (mOutputPath .mEndpointId );
155
+ EndpointId id = mDataModelProvider ->NextEndpoint (mOutputPath .mEndpointId );
156
156
return (id != kInvalidEndpointId ) ? std::make_optional (id) : std::nullopt;
157
157
}
158
158
0 commit comments