#include <ruleEvaluator.h>
Public Types | |
Type Definitions | |
typedef std::list< std::pair< Expression, String > > | RuleList |
Type definition for a list containing rules. | |
typedef StringHashMap< RuleList > | RuleMap |
Type definition for a hashmap containing the lists of rules. | |
Public Member Functions | |
Constructors and Destructor | |
RuleEvaluator () throw () | |
Default constructor. | |
RuleEvaluator (INIFile &file, const String &prefix) throw () | |
Detailed constructor. | |
RuleEvaluator (const RuleEvaluator &evaluator) throw () | |
Copy constructor. | |
virtual | ~RuleEvaluator () throw () |
Destructor. | |
Accessors | |
bool | initialize (INIFile &file, const String &prefix) throw () |
const String & | getPrefix () const throw () |
Return the prefix of the INI file sections. | |
void | setPrefix (const String &prefix) throw () |
Set the prefix of the INI file sections. | |
Assignment | |
const RuleEvaluator & | operator= (const RuleEvaluator &evaluator) throw () |
Assignment operator. | |
virtual void | clear () throw () |
Clear method. | |
Predicates | |
String | operator() (const Atom &atom) const throw () |
Rule evaluation. | |
bool | operator== (const RuleEvaluator &evaluator) const throw () |
Equality operator. | |
Debugging and Diagnostics | |
bool | isValid () const throw () |
void | dump (std::ostream &s=std::cout, Size indent_depth=0) const throw () |
Protected Member Functions | |
void | extractSection_ (INIFile &file, const String &symbol) throw () |
Protected Attributes | |
String | prefix_ |
RuleMap | rule_map_ |
bool | valid_ |
This class provides means for evaluating rules on Atoms. It is a helper class of RuleProcessors. Rules define values depending on atom constellations. They are defined in an INIFile.
|
Type definition for a list containing rules.
|
|
Type definition for a hashmap containing the lists of rules.
|
|
Rule evaluation. Evaluate all matching rules (in the correct order) and return the corresponding value. If no rule matches, an empty string is returned. |