Horizon
board_package.hpp
1 #pragma once
2 #include "block/component.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "pool/package.hpp"
5 #include "util/placement.hpp"
6 #include "util/uuid.hpp"
7 #include "util/uuid_ptr.hpp"
8 #include <fstream>
9 #include <map>
10 #include <vector>
11 
12 namespace horizon {
13 using json = nlohmann::json;
14 
15 class BoardPackage {
16 public:
17  BoardPackage(const UUID &uu, const json &, Block &block, class IPool &pool);
18  BoardPackage(const UUID &uu, Component *comp);
19  BoardPackage(const UUID &uu);
20  BoardPackage(shallow_copy_t sh, const BoardPackage &other);
21  UUID uuid;
22  uuid_ptr<Component> component;
23  const Package *alternate_package = nullptr;
24  UUID model;
25 
26  const Package *pool_package;
27  Package package;
28 
29  Placement placement;
30  bool flip = false;
31  bool smashed = false;
32  bool omit_silkscreen = false;
33  bool fixed = false;
34  bool omit_outline = false;
35  std::vector<uuid_ptr<Text>> texts;
36 
37  std::string replace_text(const std::string &t, bool *replaced = nullptr) const;
38 
39  UUID get_uuid() const;
40  json serialize() const;
41  static std::vector<UUID> peek_texts(const json &j);
42 };
43 } // namespace horizon
horizon::uuid_ptr
Definition: uuid_ptr.hpp:8
horizon::shallow_copy_t
Definition: common.hpp:270
horizon::Block
A block is one level of hierarchy in the netlist.
Definition: block.hpp:25
horizon::BoardPackage
Definition: board_package.hpp:15
horizon::Component
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
horizon::IPool
Definition: ipool.hpp:12
horizon::Package
Definition: package.hpp:29
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
horizon::Placement
Definition: placement.hpp:8