Line data Source code
1 : /*
2 : * Copyright (c) 2025 Project CHIP Authors
3 : * All rights reserved.
4 : *
5 : * Licensed under the Apache License, Version 2.0 (the "License");
6 : * you may not use this file except in compliance with the License.
7 : * You may obtain a copy of the License at
8 : *
9 : * http://www.apache.org/licenses/LICENSE-2.0
10 : *
11 : * Unless required by applicable law or agreed to in writing, software
12 : * distributed under the License is distributed on an "AS IS" BASIS,
13 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 : * See the License for the specific language governing permissions and
15 : * limitations under the License.
16 : */
17 : #pragma once
18 :
19 : #include <app/data-model-provider/ProviderChangeListener.h>
20 :
21 : #include <vector>
22 :
23 : namespace chip {
24 : namespace Test {
25 :
26 : /// A provider change listener that stores all dirty reports
27 : /// into an internal vector
28 : class TestProviderChangeListener : public app::DataModel::ProviderChangeListener
29 : {
30 : public:
31 1 : void MarkDirty(const app::AttributePathParams & path) override { mDirtyList.push_back(path); }
32 :
33 2 : std::vector<app::AttributePathParams> & DirtyList() { return mDirtyList; }
34 : const std::vector<app::AttributePathParams> & DirtyList() const { return mDirtyList; }
35 :
36 : private:
37 : std::vector<app::AttributePathParams> mDirtyList;
38 : };
39 :
40 : } // namespace Test
41 : } // namespace chip
|