Horizon
block_instance.hpp
1 #pragma once
2 #include "component.hpp"
3 #include "util/uuid_ptr.hpp"
4 
5 namespace horizon {
6 using json = nlohmann::json;
7 
9 public:
10  BlockInstanceMapping(const json &j);
11  BlockInstanceMapping(const Block &block);
12 
13  class ComponentInfo {
14  public:
15  ComponentInfo(const json &j);
16  ComponentInfo();
17 
18  std::string refdes;
19  bool nopopulate = false;
20 
21  json serialize() const;
22  };
23 
24  UUID block;
25  std::map<UUID, ComponentInfo> components;
26  json serialize() const;
27 };
28 
30 public:
31  BlockInstance(const UUID &uu, const json &j, class IBlockProvider &prv, class Block *block = nullptr);
32  BlockInstance(const UUID &uu, Block &block);
33 
34  static UUID peek_block_uuid(const json &j);
35 
36  UUID uuid;
37 
38  uuid_ptr<Block> block;
39  std::string refdes;
40 
41  std::map<UUID, Connection> connections;
42 
43  std::string replace_text(const std::string &t, bool *replaced = nullptr) const;
44 
45  UUID get_uuid() const;
46 
47  json serialize() const;
48 };
49 } // namespace horizon
Definition: block_instance.hpp:13
Definition: block_instance.hpp:8
Definition: block_instance.hpp:29
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: iblock_provider.hpp:5
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: uuid_ptr.hpp:8
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62