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, mx::app::appConfigurator &config)
 Load the rule and properties maps for a rule engine from a configuration file. 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().

◆ loadRuleConfig()

void loadRuleConfig ( indiRuleMaps maps,
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
[in]configthe application configuration structure

Definition at line 98 of file indiCompRuleConfig.hpp.

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