xref: /openbmc/entity-manager/src/topology.hpp (revision ee1db76f)
1 #pragma once
2 
3 #include <nlohmann/json.hpp>
4 
5 #include <set>
6 #include <unordered_map>
7 
8 using Association = std::tuple<std::string, std::string, std::string>;
9 
10 class Topology
11 {
12   public:
13     explicit Topology() = default;
14 
15     void addBoard(const std::string& path, const std::string& boardType,
16                   const nlohmann::json& exposesItem);
17     std::unordered_map<std::string, std::vector<Association>> getAssocs();
18 
19   private:
20     using Path = std::string;
21     using BoardType = std::string;
22     using PortType = std::string;
23 
24     std::unordered_map<PortType, std::vector<Path>> upstreamPorts;
25     std::unordered_map<PortType, std::vector<Path>> downstreamPorts;
26     std::unordered_map<Path, BoardType> boardTypes;
27 };
28