Horizon
blocks_schematic.hpp
1 #pragma once
2 #include "blocks.hpp"
3 #include "block_symbol/block_symbol.hpp"
4 #include "schematic/schematic.hpp"
5 #include "iblock_symbol_and_schematic_provider.hpp"
6 
7 namespace horizon {
9 public:
10  class BlockItemSchematic : public BlockItem {
11  public:
12  BlockItemSchematic(const BlockItemInfo &inf, const std::string &base_path, IPool &pool,
13  class BlocksSchematic &blocks);
14  BlockItemSchematic(const UUID &uu, const std::string &block_name);
15 
16  // so we can use load_and_log
17  BlockItemSchematic(const UUID &uu, const BlockItemInfo &inf, const std::string &base_path, IPool &pool,
18  class BlocksSchematic &blocks);
19 
20  BlockItemSchematic(const BlockItemInfo &inf, const json &j_block, const json &j_sym, const json &j_sch,
21  IPool &pool, BlocksSchematic &blocks);
22 
23  BlockSymbol symbol;
24  Schematic schematic;
25  };
26 
28  BlocksSchematic(const json &j, const std::string &base_path, IPool &pool);
29  static BlocksSchematic new_from_file(const std::string &filename, IPool &pool);
30  BlocksSchematic(const BlocksSchematic &other);
31 
32  std::map<UUID, BlockItemSchematic> blocks;
33 
34  std::vector<const BlockItemSchematic *> get_blocks_sorted() const;
35 
36  BlockItemSchematic &get_top_block_item();
37  const BlockItemSchematic &get_top_block_item() const;
38 
39  BlockItemSchematic &add_block(const std::string &name);
40 
41  Block &get_block(const UUID &uu) override;
42  std::map<UUID, Block *> get_blocks() override;
43  Block &get_top_block() override;
44  BlockSymbol &get_block_symbol(const UUID &uu) override;
45  Schematic &get_schematic(const UUID &uu) override;
46  json serialize() const;
47 };
48 
49 } // namespace horizon
Definition: block_symbol.hpp:51
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: blocks.hpp:13
Definition: blocks.hpp:27
Definition: blocks.hpp:11
Definition: blocks_schematic.hpp:10
Definition: blocks_schematic.hpp:8
Definition: iblock_provider.hpp:5
Definition: iblock_symbol_and_schematic_provider.hpp:6
Definition: ipool.hpp:14
A Schematic is the visual representation of a Block.
Definition: schematic.hpp:30
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
a class to store JSON values
Definition: json.hpp:177