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 "pool/pool.hpp"
6 #include "util/placement.hpp"
7 #include "util/uuid.hpp"
8 #include "util/uuid_provider.hpp"
9 #include "util/uuid_ptr.hpp"
10 #include <fstream>
11 #include <map>
12 #include <vector>
13 
14 namespace horizon {
15 using json = nlohmann::json;
16 
17 class BoardPackage : public UUIDProvider {
18 public:
19  BoardPackage(const UUID &uu, const json &, Block &block, Pool &pool);
20  BoardPackage(const UUID &uu, Component *comp);
21  BoardPackage(const UUID &uu);
22  BoardPackage(shallow_copy_t sh, const BoardPackage &other);
23  UUID uuid;
24  uuid_ptr<Component> component;
25  const Package *alternate_package = nullptr;
26  UUID model;
27 
28  const Package *pool_package;
29  Package package;
30 
31  Placement placement;
32  bool flip = false;
33  bool smashed = false;
34  bool omit_silkscreen = false;
35  bool fixed = false;
36  bool omit_outline = false;
37  std::vector<uuid_ptr<Text>> texts;
38 
39  std::string replace_text(const std::string &t, bool *replaced = nullptr) const;
40 
41  UUID get_uuid() const override;
42  json serialize() const;
43  static std::vector<UUID> peek_texts(const json &j);
44 };
45 } // namespace horizon
horizon::uuid_ptr
Definition: uuid_ptr.hpp:9
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
horizon::shallow_copy_t
Definition: common.hpp:243
horizon::Block
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
horizon::BoardPackage
Definition: board_package.hpp:17
horizon::Component
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
horizon::Package
Definition: package.hpp:28
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:165
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::Pool
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:21
horizon::UUIDProvider
Interface for objects that have a UUID.
Definition: uuid_provider.hpp:9
horizon::Placement
Definition: placement.hpp:8