BALL 1.5.0
Loading...
Searching...
No Matches
ruleEvaluator.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: ruleEvaluator.h,v 1.16 2005/12/23 17:01:52 amoll Exp $
5//
6
7// Molecular Mechanics: rule-based assignment of properties (typenames, charges, radii, etc.)
8
9#ifndef BALL_MOLMEC_COMMON_RULEEVALUATOR_H
10#define BALL_MOLMEC_COMMON_RULEEVALUATOR_H
11
12#ifndef BALL_DATATYPE_STRINGHASHMAP_H
14#endif
15
16#ifndef BALL_KERNEL_EXPRESSION_H
18#endif
19
20#include <list>
21#include <utility>
22
23namespace BALL
24{
25 class INIFile;
26
38 {
39 public:
40
42
43
46
47
49 typedef std::list<std::pair<Expression, String> > RuleList;
50
54
56
59
63
66 RuleEvaluator(INIFile& file, const String& prefix) ;
67
70 RuleEvaluator(const RuleEvaluator& evaluator) ;
71
74 virtual ~RuleEvaluator() ;
75
77
80
83 bool initialize(INIFile& file, const String& prefix) ;
84
87 const String& getPrefix() const ;
88
91 void setPrefix(const String& prefix) ;
92
94
97
100 const RuleEvaluator& operator = (const RuleEvaluator& evaluator)
101 ;
102
105 virtual void clear() ;
106
108
111
117 String operator () (const Atom& atom) const ;
118
120 bool operator == (const RuleEvaluator& evaluator) const ;
121
123
126
129 bool isValid() const ;
130
133 void dump(std::ostream& s = std::cout, Size indent_depth = 0) const
134 ;
135
137
138 protected:
139
140 //_ parse the section with name: predicate_ + ":" + symbol of file
141 void extractSection_(INIFile& file, const String& symbol) ;
142
143 //_ The INI file section prefix
144 String prefix_;
145
146 //_ The map relating an element name and the corresponding list of expressions
147 RuleMap rule_map_;
148
149 //_
150 bool valid_;
151
152 };
153} // namespace BALL
154
155
156#endif // BALL_MOLMEC_COMMON_RULEEVALUATOR_H
#define BALL_CREATE(name)
Definition create.h:62
STL namespace.
std::list< std::pair< Expression, String > > RuleList
#define BALL_EXPORT