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  UUID uuid;
23  uuid_ptr<Component> component;
24  const Package *alternate_package = nullptr;
25  UUID model;
26 
27  const Package *pool_package;
28  Package package;
29 
30  Placement placement;
31  bool flip = false;
32  bool smashed = false;
33  bool omit_silkscreen = false;
34  bool fixed = 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 override;
40  json serialize() const;
41 };
42 } // namespace horizon
horizon::uuid_ptr
Definition: uuid_ptr.hpp:9
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
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:161
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