Zigbee Protocol Controller 1.6.0
zigpc_diagnostics_manager.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
14#ifndef ZIGPC_DIAGNOSTIC_MANAGER_H
15#define ZIGPC_DIAGNOSTIC_MANAGER_H
16
17#include <map>
18#include <memory>
19#include <string>
20#include <vector>
21
24
26{
27 private:
28 /* data */
29 std::map<std::string, std::shared_ptr<zigpc_diagnostics_metric>> metric_map;
31 //unid of the device
32 std::string unid;
33
34 protected:
35
36
37 public:
38 void notify(std::string metric_id);
39
41
42 std::string get_unid()
43 {
44 return unid;
45 }
46
47 void set_unid(std::string unid)
48 {
49 this->unid = unid;
50 }
52
54 void operator=(const zigpc_diagnostics_manager &) = delete;
55
57
63 void handle_metricID_request(std::vector<std::string> metric_id_vector);
64
71 void add_metric(std::shared_ptr<zigpc_diagnostics_metric> metric)
72 {
73 metric_map[metric->get_metric_id()] = metric;
74 };
75};
76
77#endif /* ZIGPC_DIAGNOSTIC_MANAGER_H */
Definition: zigpc_diagnostics_manager.hpp:26
void handle_metricID_request(std::vector< std::string > metric_id_vector)
Accept list of Metric IDs to trigger update.
void set_unid(std::string unid)
Definition: zigpc_diagnostics_manager.hpp:47
zigpc_diagnostics_manager(zigpc_diagnostics_manager &other)=delete
void operator=(const zigpc_diagnostics_manager &)=delete
std::string unid
Definition: zigpc_diagnostics_manager.hpp:32
void notify(std::string metric_id)
std::map< std::string, std::shared_ptr< zigpc_diagnostics_metric > > metric_map
Definition: zigpc_diagnostics_manager.hpp:29
static zigpc_diagnostics_manager & get_instance()
void add_metric(std::shared_ptr< zigpc_diagnostics_metric > metric)
add a metric to the diagnostic manager internal map
Definition: zigpc_diagnostics_manager.hpp:71
std::string get_unid()
Definition: zigpc_diagnostics_manager.hpp:42
Definition: zigpc_diagnostics_notification.hpp:20