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, const json &j);
25  BusRipper(const UUID &uu);
26  virtual UUID get_uuid() const;
27  UUID uuid;
28  bool temp = false;
29 
30  uuid_ptr<Junction> junction;
31  Orientation orientation = Orientation::UP;
32  void mirror();
33  uuid_ptr<Bus> bus = nullptr;
34  uuid_ptr<Bus::Member> bus_member = nullptr;
35  unsigned int connection_count = 0;
36 
37  void update_refs(class Sheet &sheet, class Block &block);
38  Coordi get_connector_pos() const;
39 
40 
41  json serialize() const;
42 
43  UUID net_segment; // net segment from net, not from bus
44 };
45 } // 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:165
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