Configuration of rules for the MagAO-X stateRuleEngine. More...


Go to the source code of this file.
Classes | |
| struct | indiRuleMaps |
| Structure to provide management of the rule and property maps. More... | |
| struct | ruleRuleKeys |
Functions | |
| void | extractRuleProp (pcf::IndiProperty **prop, std::string &element, indiRuleMaps &maps, const std::string §ion, const std::string &propkey, const std::string &elkey, const pcf::IndiProperty::Type &type, mx::app::appConfigurator &config) |
| Extract a property from a rule configuration. | |
| void | loadRuleConfig (indiRuleMaps &maps, std::map< std::string, ruleRuleKeys > &rrkMap, mx::app::appConfigurator &config) |
| Load the rule and properties maps for a rule engine from a configuration file. | |
| void | finalizeRuleValRules (indiRuleMaps &maps, std::map< std::string, ruleRuleKeys > &rrkMap) |
| Finalize ruleVal rules. | |
Configuration of rules for the MagAO-X stateRuleEngine.
Definition in file indiCompRuleConfig.hpp.
| struct ruleRuleKeys |
Definition at line 47 of file indiCompRuleConfig.hpp.

| Class Members | ||
|---|---|---|
| string | rule1 | |
| string | rule2 | |
| void extractRuleProp | ( | pcf::IndiProperty ** | prop, |
| std::string & | element, | ||
| indiRuleMaps & | maps, | ||
| const std::string & | section, | ||
| const std::string & | propkey, | ||
| const std::string & | elkey, | ||
| const pcf::IndiProperty::Type & | type, | ||
| mx::app::appConfigurator & | config | ||
| ) |
Extract a property from a rule configuration.
Reads the property and element, adding the property to the property map if necessary.
| mx::err::invalidconfig | if the property is already in the map but of a different type |
| [out] | prop | pointer to the property, newly created or existing, which is in the map. |
| [out] | element | the element name from the configuration |
| [in] | maps | contains the property map to which the property is added |
| [in] | section | name of the section for this rule |
| [in] | propkey | the key for the property name |
| [in] | elkey | the key for the element name |
| [in] | type | the type of the property |
| [in] | config | the application configuration structure |
Definition at line 58 of file indiCompRuleConfig.hpp.
References indiRuleMaps::props.
Referenced by loadRuleConfig().
| void finalizeRuleValRules | ( | indiRuleMaps & | maps, |
| std::map< std::string, ruleRuleKeys > & | rrkMap | ||
| ) |
Finalize ruleVal rules.
///
check for insertion failure ///
add a constructor that has priority, message, and comparison, to reduce duplication
| maps | [in/out] contains the rule and property maps with rules ot finalize | |
| [out] | rrkMap | Holds the ruleVal rule keys aside for later post-processing |
Definition at line 326 of file indiCompRuleConfig.hpp.
References ruleCompRule::rule1(), ruleCompRule::rule2(), and indiRuleMaps::rules.
Referenced by MagAOX::app::stateRuleEngine::loadConfigImpl().
| void loadRuleConfig | ( | indiRuleMaps & | maps, |
| std::map< std::string, ruleRuleKeys > & | rrkMap, | ||
| mx::app::appConfigurator & | config | ||
| ) |
Load the rule and properties maps for a rule engine from a configuration file.
///
check for insertion failure ///
add a constructor that has priority, message, and comparison, to reduce duplication
| [out] | maps | contains the rule and property maps in which to place the items found in config |
| [out] | rrkMap | Holds the ruleVal rule keys aside for later post-processing |
| [in] | config | the application configuration structure |
Definition at line 98 of file indiCompRuleConfig.hpp.
References indiCompRule::comparison(), onePropRule::element(), twoPropRule::element1(), twoPropRule::element2(), extractRuleProp(), indiCompRule::message(), numValRule::name, txtValRule::name, swValRule::name, elCompNumRule::name, elCompTxtRule::name, elCompSwRule::name, ruleCompRule::name, indiCompRule::priority(), onePropRule::property(), twoPropRule::property1(), twoPropRule::property2(), ruleRuleKeys::rule1, ruleRuleKeys::rule2, indiRuleMaps::rules, string2comp(), string2priority(), numValRule::target(), swValRule::target(), txtValRule::target(), and numValRule::tol().
Referenced by MagAOX::app::stateRuleEngine::loadConfigImpl().