Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

RuleEvaluator Class Reference
[Rule-based parameter assignment]

Rule evaluator class. More...

#include <ruleEvaluator.h>

List of all members.

Public Types

Type Definitions
typedef std::list< std::pair<
Expression, String > > 
RuleList
 Type definition for a list containing rules.
typedef StringHashMap< RuleListRuleMap
 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 StringgetPrefix () 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 RuleEvaluatoroperator= (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_


Detailed Description

Rule evaluator class.

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.

See also:
RuleProcessor


Member Typedef Documentation

typedef std::list<std::pair<Expression, String> > RuleEvaluator::RuleList
 

Type definition for a list containing rules.

typedef StringHashMap<RuleList> RuleEvaluator::RuleMap
 

Type definition for a hashmap containing the lists of rules.


Member Function Documentation

String RuleEvaluator::operator() const Atom atom  )  const throw ()
 

Rule evaluation.

Evaluate all matching rules (in the correct order) and return the corresponding value. If no rule matches, an empty string is returned.