Horizon
junction.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "block/net.hpp"
5 #include "util/uuid_ptr.hpp"
6 #include "nlohmann/json_fwd.hpp"
7 #include "block/bus.hpp"
8 #include "util/layer_range.hpp"
9 
10 namespace horizon {
11 using json = nlohmann::json;
12 
22 class Junction {
23 public:
24  Junction(const UUID &uu, const json &j);
25  Junction(const UUID &uu);
26 
27  UUID uuid;
28  Coord<int64_t> position;
29 
30 
31  UUID get_uuid() const;
32 
33  // not stored
34  uuid_ptr<Net> net = nullptr;
35  uuid_ptr<Bus> bus = nullptr;
36  UUID net_segment = UUID();
37  bool warning = false;
38  LayerRange layer = 10000;
39  bool needs_via = false;
40  bool has_via = false; // in schematic: true if has net label, etc.
41  unsigned int connection_count = 0;
42 
43  json serialize() const;
44 };
45 } // namespace horizon
horizon::LayerRange
Definition: layer_range.hpp:7
horizon::uuid_ptr
Definition: uuid_ptr.hpp:8
horizon::Coord< int64_t >
horizon::Junction
A Junction is a point in 2D-Space.
Definition: junction.hpp:22
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