Horizon
bus_label.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 #include "nlohmann/json_fwd.hpp"
13 
14 
15 namespace horizon {
16 using json = nlohmann::json;
17 
22 class BusLabel {
23 public:
24  BusLabel(const UUID &uu, const json &j, class Sheet &sheet, class Block &block);
25  BusLabel(const UUID &uu, const json &j);
26  BusLabel(const UUID &uu);
27 
28  UUID uuid;
29 
30  enum class Style { PLAIN, FLAG };
31  Style style = Style::FLAG;
32 
33  uuid_ptr<Junction> junction;
34  Orientation orientation = Orientation::RIGHT;
35  uint64_t size = 1.5_mm;
36  std::set<unsigned int> on_sheets;
37  bool offsheet_refs = true;
38  uuid_ptr<Bus> bus;
39 
40  json serialize() const;
41 };
42 } // namespace horizon
horizon::uuid_ptr
Definition: uuid_ptr.hpp:8
horizon::BusLabel
Makes a Bus available on the schematic.
Definition: bus_label.hpp:22
horizon::Block
A block is one level of hierarchy in the netlist.
Definition: block.hpp:25
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
libzip::uint64_t
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108