blob: 18c92446d9ea9dfc122c6b0044c5156944d5fcb0 [file] [log] [blame]
Benjamin Fairf2f5b7a2022-09-09 19:45:02 +00001#pragma once
2
3#include <nlohmann/json.hpp>
4
5#include <set>
6#include <unordered_map>
7
8using Association = std::tuple<std::string, std::string, std::string>;
9
10class 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};