API
indiCompRuleConfig.hpp File Reference

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

#include <map>
#include "indiCompRules.hpp"
Include dependency graph for indiCompRuleConfig.hpp:
This graph shows which files directly or indirectly include this file:

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 &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. More...
 
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. More...
 
void finalizeRuleValRules (indiRuleMaps &maps, std::map< std::string, ruleRuleKeys > &rrkMap)
 Finalize ruleVal rules. More...
 

Detailed Description

Configuration of rules for the MagAO-X stateRuleEngine.

Definition in file indiCompRuleConfig.hpp.


Class Documentation

◆ ruleRuleKeys

struct ruleRuleKeys

Definition at line 47 of file indiCompRuleConfig.hpp.

Collaboration diagram for ruleRuleKeys:
Collaboration graph
Class Members
string rule1
string rule2

Function Documentation

◆ extractRuleProp()

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.

Exceptions
mx::err::invalidconfigif the property is already in the map but of a different type
Todo:
have to split device and propertyName
Parameters
[out]proppointer to the property, newly created or existing, which is in the map.
[out]elementthe element name from the configuration
[in]mapscontains the property map to which the property is added
[in]sectionname of the section for this rule
[in]propkeythe key for the property name
[in]elkeythe key for the element name
[in]typethe type of the property
[in]configthe application configuration structure

Definition at line 58 of file indiCompRuleConfig.hpp.

Referenced by loadRuleConfig().

◆ finalizeRuleValRules()

void finalizeRuleValRules ( indiRuleMaps maps,
std::map< std::string, ruleRuleKeys > &  rrkMap 
)

Finalize ruleVal rules.

///

Todo:

check for insertion failure ///

add a constructor that has priority, message, and comparison, to reduce duplication

Parameters
maps[in/out] contains the rule and property maps with rules ot finalize
[out]rrkMapHolds the ruleVal rule keys aside for later post-processing

Definition at line 326 of file indiCompRuleConfig.hpp.

Referenced by MagAOX::app::stateRuleEngine::loadConfigImpl().

◆ loadRuleConfig()

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.

///

Todo:

check for insertion failure ///

add a constructor that has priority, message, and comparison, to reduce duplication

Parameters
[out]mapscontains the rule and property maps in which to place the items found in config
[out]rrkMapHolds the ruleVal rule keys aside for later post-processing
[in]configthe application configuration structure

Definition at line 98 of file indiCompRuleConfig.hpp.

Referenced by MagAOX::app::stateRuleEngine::loadConfigImpl().