Coverage Report

Created: 2025-06-24 06:17

/src/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/include/WhmInstance.h
Line
Count
Source
1
/*
2
 *
3
 *    Copyright (c) 2024 Project CHIP Authors
4
 *    All rights reserved.
5
 *
6
 *    Licensed under the Apache License, Version 2.0 (the "License");
7
 *    you may not use this file except in compliance with the License.
8
 *    You may obtain a copy of the License at
9
 *
10
 *        http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 *    Unless required by applicable law or agreed to in writing, software
13
 *    distributed under the License is distributed on an "AS IS" BASIS,
14
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 *    See the License for the specific language governing permissions and
16
 *    limitations under the License.
17
 */
18
19
#pragma once
20
21
#include <WhmDelegate.h>
22
#include <app/clusters/water-heater-management-server/water-heater-management-server.h>
23
#include <app/util/af-types.h>
24
#include <lib/core/CHIPError.h>
25
26
namespace chip {
27
namespace app {
28
namespace Clusters {
29
namespace WaterHeaterManagement {
30
using namespace chip::app::Clusters::WaterHeaterManagement;
31
32
class WaterHeaterManagementInstance : public Instance
33
{
34
public:
35
    WaterHeaterManagementInstance(EndpointId aEndpointId, WaterHeaterManagementDelegate & aDelegate, Feature aFeature) :
36
1
        WaterHeaterManagement::Instance(aEndpointId, aDelegate, aFeature)
37
1
    {
38
1
        mDelegate = &aDelegate;
39
1
    }
40
41
    // Delete copy constructor and assignment operator.
42
    WaterHeaterManagementInstance(const WaterHeaterManagementInstance &)             = delete;
43
    WaterHeaterManagementInstance(const WaterHeaterManagementInstance &&)            = delete;
44
    WaterHeaterManagementInstance & operator=(const WaterHeaterManagementInstance &) = delete;
45
46
    CHIP_ERROR Init();
47
    void Shutdown();
48
49
1
    WaterHeaterManagementDelegate * GetDelegate() { return mDelegate; };
50
51
private:
52
    WaterHeaterManagementDelegate * mDelegate;
53
};
54
55
} // namespace WaterHeaterManagement
56
} // namespace Clusters
57
} // namespace app
58
} // namespace chip