1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "pool/unit.hpp"
4 #include "util/uuid.hpp"
5 #include "util/uuid_ptr.hpp"
6 #include <fstream>
7 #include <map>
8 #include <vector>
9 
10 #include "net_class.hpp"
11 
12 namespace horizon {
13 using json = nlohmann::json;
14 
15 class Net {
16 public:
17     Net(const UUID &uu, const json &, class Block &block);
18     Net(const UUID &uu, const json &);
19     Net(const UUID &uu);
20     UUID get_uuid() const;
21     UUID uuid;
22     std::string name;
23     bool is_power = false;
24 
25     enum class PowerSymbolStyle { GND, EARTH, DOT, ANTENNA };
26     PowerSymbolStyle power_symbol_style = PowerSymbolStyle::GND;
27     bool power_symbol_name_visible = true;
28 
29     uuid_ptr<NetClass> net_class;
30     uuid_ptr<Net> diffpair;
31     bool diffpair_master = false;
32 
33     // not saved
34     bool is_power_forced = false;
35     bool is_bussed = false;
36     unsigned int n_pins_connected = 0;
37     bool has_bus_rippers = false;
38     json serialize() const;
39     bool is_named() const;
40 };
41 } // namespace horizon
42