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