Horizon
schematic_rules.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "rules/rules.hpp"
5 #include "rule_single_pin_net.hpp"
6 
7 namespace horizon {
8 using json = nlohmann::json;
9 
10 class SchematicRules : public Rules {
11 public:
13 
14  void load_from_json(const json &j) override;
15  RulesCheckResult check(RuleID id, const class Schematic &sch, class RulesCheckCache &cache) const;
16  void apply(RuleID id, class Schematic *sch);
17  json serialize() const override;
18  std::vector<RuleID> get_rule_ids() const override;
19  const Rule &get_rule(RuleID id) const override;
20  const Rule &get_rule(RuleID id, const UUID &uu) const override;
21  std::map<UUID, const Rule *> get_rules(RuleID id) const override;
22  void remove_rule(RuleID id, const UUID &uu) override;
23  Rule &add_rule(RuleID id) override;
24 
25 private:
26  RuleSinglePinNet rule_single_pin_net;
27 
28  RulesCheckResult check_single_pin_net(const class Schematic &sch, class RulesCheckCache &cache) const;
29 };
30 } // namespace horizon
Definition: rule_single_pin_net.hpp:5
Definition: rule.hpp:54
Definition: cache.hpp:54
Definition: rules.hpp:36
Definition: rules.hpp:51
Definition: schematic_rules.hpp:10
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
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62