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