Line data Source code
1 : /*
2 : * Copyright (c) 2024 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/AttributePathParams.h>
20 :
21 : namespace chip {
22 : namespace app {
23 : namespace DataModel {
24 :
25 : /// Notification listener for changes of the underlying data in a
26 : /// data model.
27 : ///
28 : /// Used to notify that a specific attribute path (or several attributes
29 : /// via wildcards) have changed their underlying content.
30 : ///
31 : /// Methods on this class MUST be called from within the matter
32 : /// main loop as they will likely trigger interaction model
33 : /// internal updates and subscription data reporting.
34 : class ProviderChangeListener
35 : {
36 : public:
37 60 : virtual ~ProviderChangeListener() = default;
38 :
39 : /// Mark all attributes matching the given path (which may be a wildcard) dirty.
40 : ///
41 : /// Wildcards are supported.
42 : virtual void MarkDirty(const AttributePathParams & path) = 0;
43 : };
44 :
45 : } // namespace DataModel
46 : } // namespace app
47 : } // namespace chip
|