Horizon
rule.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "rule_match.hpp"
4 #include "util/uuid.hpp"
5 
6 namespace horizon {
7 using json = nlohmann::json;
8 
9 enum class RuleID {
10  NONE,
11  HOLE_SIZE,
12  CLEARANCE_SILKSCREEN_EXPOSED_COPPER,
13  TRACK_WIDTH,
14  CLEARANCE_COPPER,
15  SINGLE_PIN_NET,
16  PARAMETERS,
17  VIA,
18  CLEARANCE_COPPER_OTHER,
19  PLANE,
20  DIFFPAIR,
21  PACKAGE_CHECKS
22 };
23 
24 class Rule {
25 public:
26  Rule();
27  Rule(const UUID &uu);
28  Rule(const json &j);
29  Rule(const UUID &uu, const json &j);
30  UUID uuid;
31  int order = 0;
32  RuleID id = RuleID::NONE;
33  bool enabled = true;
34 
35  virtual json serialize() const;
36  virtual std::string get_brief(const class Block *block = nullptr) const = 0;
37 
38  virtual ~Rule();
39 };
40 } // namespace horizon
a class to store JSON values
Definition: json.hpp:161
Definition: rule.hpp:24
A block is one level of hierarchy in the netlist.
Definition: block.hpp:25
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: block.cpp:7
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61