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