Coverage Report

Created: 2026-08-14 07:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/UnitTesting/Structs.h
Line
Count
Source
1
/*
2
 *
3
 *    Copyright (c) 2022 Project CHIP Authors
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
18
// THIS FILE IS GENERATED BY ZAP
19
// This file is generated from clusters-Structs.h.zapt
20
21
#pragma once
22
23
#include <app/data-model/DecodableList.h>
24
#include <app/data-model/List.h>
25
#include <app/data-model/Nullable.h>
26
#include <lib/core/DataModelTypes.h>
27
#include <lib/core/Optional.h>
28
#include <lib/core/TLV.h>
29
#include <lib/support/BitMask.h>
30
31
#include <clusters/shared/Structs.h>
32
33
#include <cstdint>
34
35
namespace chip {
36
namespace app {
37
namespace Clusters {
38
namespace UnitTesting {
39
namespace Structs {
40
namespace SimpleStruct {
41
enum class Fields : uint8_t
42
{
43
    kA = 0,
44
    kB = 1,
45
    kC = 2,
46
    kD = 3,
47
    kE = 4,
48
    kF = 5,
49
    kG = 6,
50
    kH = 7,
51
    kI = 8,
52
};
53
54
struct Type
55
{
56
public:
57
    uint8_t a    = static_cast<uint8_t>(0);
58
    bool b       = static_cast<bool>(0);
59
    SimpleEnum c = static_cast<SimpleEnum>(0);
60
    chip::ByteSpan d;
61
    chip::CharSpan e;
62
    chip::BitMask<SimpleBitmap> f = static_cast<chip::BitMask<SimpleBitmap>>(0);
63
    float g                       = static_cast<float>(0);
64
    double h                      = static_cast<double>(0);
65
    Optional<Globals::TestGlobalEnum> i;
66
67
    CHIP_ERROR Decode(TLV::TLVReader & reader);
68
69
    static constexpr bool kIsFabricScoped = false;
70
71
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
72
};
73
74
using DecodableType = Type;
75
76
} // namespace SimpleStruct
77
namespace TestFabricScoped {
78
enum class Fields : uint8_t
79
{
80
    kFabricSensitiveInt8u                 = 1,
81
    kOptionalFabricSensitiveInt8u         = 2,
82
    kNullableFabricSensitiveInt8u         = 3,
83
    kNullableOptionalFabricSensitiveInt8u = 4,
84
    kFabricSensitiveCharString            = 5,
85
    kFabricSensitiveStruct                = 6,
86
    kFabricSensitiveInt8uList             = 7,
87
    kFabricIndex                          = 254,
88
};
89
90
struct Type
91
{
92
public:
93
    uint8_t fabricSensitiveInt8u = static_cast<uint8_t>(0);
94
    Optional<uint8_t> optionalFabricSensitiveInt8u;
95
    DataModel::Nullable<uint8_t> nullableFabricSensitiveInt8u;
96
    Optional<DataModel::Nullable<uint8_t>> nullableOptionalFabricSensitiveInt8u;
97
    chip::CharSpan fabricSensitiveCharString;
98
    Structs::SimpleStruct::Type fabricSensitiveStruct;
99
    DataModel::List<const uint8_t> fabricSensitiveInt8uList;
100
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
101
102
    static constexpr bool kIsFabricScoped = true;
103
104
0
    auto GetFabricIndex() const { return fabricIndex; }
105
106
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
107
108
    CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
109
    CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const;
110
111
private:
112
    CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional<FabricIndex> & aAccessingFabricIndex) const;
113
};
114
115
struct DecodableType
116
{
117
public:
118
    uint8_t fabricSensitiveInt8u = static_cast<uint8_t>(0);
119
    Optional<uint8_t> optionalFabricSensitiveInt8u;
120
    DataModel::Nullable<uint8_t> nullableFabricSensitiveInt8u;
121
    Optional<DataModel::Nullable<uint8_t>> nullableOptionalFabricSensitiveInt8u;
122
    chip::CharSpan fabricSensitiveCharString;
123
    Structs::SimpleStruct::DecodableType fabricSensitiveStruct;
124
    DataModel::DecodableList<uint8_t> fabricSensitiveInt8uList;
125
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
126
127
    CHIP_ERROR Decode(TLV::TLVReader & reader);
128
129
    static constexpr bool kIsFabricScoped = true;
130
131
0
    auto GetFabricIndex() const { return fabricIndex; }
132
133
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
134
};
135
136
} // namespace TestFabricScoped
137
namespace NullablesAndOptionalsStruct {
138
enum class Fields : uint8_t
139
{
140
    kNullableInt            = 0,
141
    kOptionalInt            = 1,
142
    kNullableOptionalInt    = 2,
143
    kNullableString         = 3,
144
    kOptionalString         = 4,
145
    kNullableOptionalString = 5,
146
    kNullableStruct         = 6,
147
    kOptionalStruct         = 7,
148
    kNullableOptionalStruct = 8,
149
    kNullableList           = 9,
150
    kOptionalList           = 10,
151
    kNullableOptionalList   = 11,
152
};
153
154
struct Type
155
{
156
public:
157
    DataModel::Nullable<uint16_t> nullableInt;
158
    Optional<uint16_t> optionalInt;
159
    Optional<DataModel::Nullable<uint16_t>> nullableOptionalInt;
160
    DataModel::Nullable<chip::CharSpan> nullableString;
161
    Optional<chip::CharSpan> optionalString;
162
    Optional<DataModel::Nullable<chip::CharSpan>> nullableOptionalString;
163
    DataModel::Nullable<Structs::SimpleStruct::Type> nullableStruct;
164
    Optional<Structs::SimpleStruct::Type> optionalStruct;
165
    Optional<DataModel::Nullable<Structs::SimpleStruct::Type>> nullableOptionalStruct;
166
    DataModel::Nullable<DataModel::List<const SimpleEnum>> nullableList;
167
    Optional<DataModel::List<const SimpleEnum>> optionalList;
168
    Optional<DataModel::Nullable<DataModel::List<const SimpleEnum>>> nullableOptionalList;
169
170
    static constexpr bool kIsFabricScoped = false;
171
172
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
173
};
174
175
struct DecodableType
176
{
177
public:
178
    DataModel::Nullable<uint16_t> nullableInt;
179
    Optional<uint16_t> optionalInt;
180
    Optional<DataModel::Nullable<uint16_t>> nullableOptionalInt;
181
    DataModel::Nullable<chip::CharSpan> nullableString;
182
    Optional<chip::CharSpan> optionalString;
183
    Optional<DataModel::Nullable<chip::CharSpan>> nullableOptionalString;
184
    DataModel::Nullable<Structs::SimpleStruct::DecodableType> nullableStruct;
185
    Optional<Structs::SimpleStruct::DecodableType> optionalStruct;
186
    Optional<DataModel::Nullable<Structs::SimpleStruct::DecodableType>> nullableOptionalStruct;
187
    DataModel::Nullable<DataModel::DecodableList<SimpleEnum>> nullableList;
188
    Optional<DataModel::DecodableList<SimpleEnum>> optionalList;
189
    Optional<DataModel::Nullable<DataModel::DecodableList<SimpleEnum>>> nullableOptionalList;
190
191
    CHIP_ERROR Decode(TLV::TLVReader & reader);
192
193
    static constexpr bool kIsFabricScoped = false;
194
};
195
196
} // namespace NullablesAndOptionalsStruct
197
namespace NestedStruct {
198
enum class Fields : uint8_t
199
{
200
    kA = 0,
201
    kB = 1,
202
    kC = 2,
203
    kD = 3,
204
};
205
206
struct Type
207
{
208
public:
209
    uint8_t a = static_cast<uint8_t>(0);
210
    bool b    = static_cast<bool>(0);
211
    Structs::SimpleStruct::Type c;
212
    Optional<Globals::Structs::TestGlobalStruct::Type> d;
213
214
    CHIP_ERROR Decode(TLV::TLVReader & reader);
215
216
    static constexpr bool kIsFabricScoped = false;
217
218
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
219
};
220
221
using DecodableType = Type;
222
223
} // namespace NestedStruct
224
namespace NestedStructList {
225
enum class Fields : uint8_t
226
{
227
    kA = 0,
228
    kB = 1,
229
    kC = 2,
230
    kD = 3,
231
    kE = 4,
232
    kF = 5,
233
    kG = 6,
234
};
235
236
struct Type
237
{
238
public:
239
    uint8_t a = static_cast<uint8_t>(0);
240
    bool b    = static_cast<bool>(0);
241
    Structs::SimpleStruct::Type c;
242
    DataModel::List<const Structs::SimpleStruct::Type> d;
243
    DataModel::List<const uint32_t> e;
244
    DataModel::List<const chip::ByteSpan> f;
245
    DataModel::List<const uint8_t> g;
246
247
    static constexpr bool kIsFabricScoped = false;
248
249
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
250
};
251
252
struct DecodableType
253
{
254
public:
255
    uint8_t a = static_cast<uint8_t>(0);
256
    bool b    = static_cast<bool>(0);
257
    Structs::SimpleStruct::DecodableType c;
258
    DataModel::DecodableList<Structs::SimpleStruct::DecodableType> d;
259
    DataModel::DecodableList<uint32_t> e;
260
    DataModel::DecodableList<chip::ByteSpan> f;
261
    DataModel::DecodableList<uint8_t> g;
262
263
    CHIP_ERROR Decode(TLV::TLVReader & reader);
264
265
    static constexpr bool kIsFabricScoped = false;
266
};
267
268
} // namespace NestedStructList
269
namespace DoubleNestedStructList {
270
enum class Fields : uint8_t
271
{
272
    kA = 0,
273
};
274
275
struct Type
276
{
277
public:
278
    DataModel::List<const Structs::NestedStructList::Type> a;
279
280
    static constexpr bool kIsFabricScoped = false;
281
282
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
283
};
284
285
struct DecodableType
286
{
287
public:
288
    DataModel::DecodableList<Structs::NestedStructList::DecodableType> a;
289
290
    CHIP_ERROR Decode(TLV::TLVReader & reader);
291
292
    static constexpr bool kIsFabricScoped = false;
293
};
294
295
} // namespace DoubleNestedStructList
296
namespace TestListStructOctet {
297
enum class Fields : uint8_t
298
{
299
    kMember1 = 0,
300
    kMember2 = 1,
301
};
302
303
struct Type
304
{
305
public:
306
    uint64_t member1 = static_cast<uint64_t>(0);
307
    chip::ByteSpan member2;
308
309
    CHIP_ERROR Decode(TLV::TLVReader & reader);
310
311
    static constexpr bool kIsFabricScoped = false;
312
313
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
314
};
315
316
using DecodableType = Type;
317
318
} // namespace TestListStructOctet
319
} // namespace Structs
320
} // namespace UnitTesting
321
} // namespace Clusters
322
} // namespace app
323
} // namespace chip