xref: /openbmc/phosphor-pid-control/pid/buildjson.hpp (revision f8b6e55147148c3cfb42327ff267197a460b411c)
1 #pragma once
2 
3 #include "conf.hpp"
4 
5 #include <nlohmann/json.hpp>
6 
7 #include <cstdint>
8 #include <map>
9 #include <utility>
10 
11 namespace pid_control
12 {
13 
14 using json = nlohmann::json;
15 
16 /**
17  * Given the json "zones" data, create the map of PIDs and the map of zones.
18  *
19  * @param[in] data - the json data
20  * @return the pidConfig, and the zoneConfig
21  */
22 std::pair<std::map<int64_t, conf::PIDConf>, std::map<int64_t, conf::ZoneConfig>>
23     buildPIDsFromJson(const json& data);
24 
25 } // namespace pid_control
26