supla-device
Loading...
Searching...
No Matches
capability_registry.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_SUPLET_CAPABILITY_REGISTRY_H_
5#define SRC_SUPLA_SUPLET_CAPABILITY_REGISTRY_H_
6
7#include <stdint.h>
8#include <supla/suplet/definition.h>
9
10namespace Supla {
11namespace Suplet {
12
14 public:
16
17 bool add(const Capability &capability);
18 void clear();
19
20 uint8_t getCount() const;
21 bool getCapability(uint8_t index, Capability *capability) const;
22
23 private:
24 struct Entry {
25 Capability capability = {};
26 Entry *next = nullptr;
27 };
28
29 bool contains(Category category, Kind kind, uint8_t handlerVersion) const;
30
31 Entry *first = nullptr;
32};
33
34} // namespace Suplet
35} // namespace Supla
36
37#endif // SRC_SUPLA_SUPLET_CAPABILITY_REGISTRY_H_
Definition capability_registry.h:13
Definition definition.h:73