Horizon
rule_descr.hpp
1 #pragma once
2 #include "rule.hpp"
3 #include <string>
4 
5 namespace horizon {
6 class RuleDescription {
7 public:
8  enum Flag {
9  IS_MULTI = (1 << 0),
10  CAN_CHECK = (1 << 1),
11  CAN_APPLY = (1 << 2),
12  NEEDS_MATCH_ALL = (1 << 3),
13  };
14 
15  RuleDescription(const std::string &n, unsigned int flags)
16  : name(n), multi(flags & IS_MULTI), can_check(flags & CAN_CHECK), can_apply(flags & CAN_APPLY),
17  needs_match_all(flags & NEEDS_MATCH_ALL)
18  {
19  }
20 
21  std::string name;
22  bool multi;
23  bool can_check;
24  bool can_apply;
25  bool needs_match_all;
26 };
27 
28 extern const std::map<RuleID, RuleDescription> rule_descriptions;
29 } // namespace horizon