Horizon
bus_ripper.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "common/common.hpp"
5 #include "util/uuid_ptr.hpp"
6 #include "block/bus.hpp"
7 #include <vector>
8 #include <map>
9 #include <set>
10 #include <fstream>
11 
12 
13 namespace horizon {
14 using json = nlohmann::json;
15 
19 class BusRipper {
20 public:
21  BusRipper(const UUID &uu, const json &j, class Sheet &sheet, class Block &block);
22  BusRipper(const UUID &uu, const json &j);
23  BusRipper(const UUID &uu);
24  UUID get_uuid() const;
25  UUID uuid;
26 
28  Orientation orientation = Orientation::UP;
29  void mirror();
30  uuid_ptr<Bus> bus = nullptr;
31  uuid_ptr<Bus::Member> bus_member = nullptr;
32  std::vector<UUID> connections;
33 
34  void update_refs(class Sheet &sheet, class Block &block);
35  Coordi get_connector_pos() const;
36 
37 
38  json serialize() const;
39 
40  UUID net_segment; // net segment from net, not from bus
41 };
42 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Make a Bus member's Net available on the schematic.
Definition: bus_ripper.hpp:19
Definition: sheet.hpp:40
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: uuid_ptr.hpp:8
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62