Horizon
buffer.hpp
1 #pragma once
2 #include "block/component.hpp"
3 #include "block/net.hpp"
4 #include "canvas/selectables.hpp"
5 #include "common/arc.hpp"
6 #include "common/hole.hpp"
7 #include "common/junction.hpp"
8 #include "common/line.hpp"
9 #include "common/polygon.hpp"
10 #include "common/shape.hpp"
11 #include "common/text.hpp"
12 #include "document/documents.hpp"
13 #include "nlohmann/json_fwd.hpp"
14 #include "package/pad.hpp"
15 #include "pool/symbol.hpp"
16 #include "schematic/net_label.hpp"
17 #include "schematic/power_symbol.hpp"
18 #include "schematic/schematic_symbol.hpp"
19 #include "board/via.hpp"
20 #include "board/track.hpp"
21 #include "board/board_hole.hpp"
22 #include "common/dimension.hpp"
23 #include "board/board_panel.hpp"
24 #include "schematic/bus_label.hpp"
25 #include "schematic/bus_ripper.hpp"
26 #include "board/board_decal.hpp"
27 #include "util/uuid.hpp"
28 #include <map>
29 #include <set>
30 
31 namespace horizon {
32 class Buffer {
33 public:
34  Buffer(Documents &cr);
35  void clear();
36  void load(std::set<SelectableRef> selection);
37 
38  std::map<UUID, Text> texts;
39  std::map<UUID, Junction> junctions;
40  std::map<UUID, Line> lines;
41  std::map<UUID, Arc> arcs;
42  std::map<UUID, Pad> pads;
43  std::map<UUID, Polygon> polygons;
44  std::map<UUID, Component> components;
45  std::map<UUID, SchematicSymbol> symbols;
46  std::map<UUID, SymbolPin> pins;
47  std::map<UUID, Net> nets;
48  std::map<UUID, LineNet> net_lines;
49  std::map<UUID, Hole> holes;
50  std::map<UUID, Shape> shapes;
51  std::map<UUID, PowerSymbol> power_symbols;
52  std::map<UUID, NetLabel> net_labels;
53  std::map<UUID, Via> vias;
54  std::map<UUID, Track> tracks;
55  std::map<UUID, BoardHole> board_holes;
56  std::map<UUID, Dimension> dimensions;
57  std::map<UUID, BoardPanel> board_panels;
58  std::map<UUID, Bus> buses;
59  std::map<UUID, BusLabel> bus_labels;
60  std::map<UUID, BusRipper> bus_rippers;
61  std::map<UUID, BoardDecal> decals;
62 
63  json serialize();
64 
65 private:
66  Documents doc;
67  NetClass net_class_dummy;
68 };
69 } // namespace horizon
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:166