00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: ruleProcessor.h,v 1.17 2005/12/23 17:01:52 amoll Exp $ 00005 // 00006 00007 // Molecular Mechanics: rule-based assignment of properties (typenames, charges, radii, etc.) 00008 00009 #ifndef BALL_MOLMEC_COMMON_RULEPROCESSOR_H 00010 #define BALL_MOLMEC_COMMON_RULEPROCESSOR_H 00011 00012 #ifndef BALL_MOLMEC_COMMON_RULEEVALUATOR_H 00013 # include <BALL/MOLMEC/COMMON/ruleEvaluator.h> 00014 #endif 00015 00016 #ifndef BALL_CONCEPT_PROCESSOR_H 00017 # include <BALL/CONCEPT/processor.h> 00018 #endif 00019 00020 namespace BALL 00021 { 00026 class BALL_EXPORT RuleProcessor 00027 : public UnaryProcessor<Atom> 00028 { 00029 public: 00030 00031 BALL_CREATE(RuleProcessor) 00032 00033 00036 00039 RuleProcessor(); 00040 00043 RuleProcessor(INIFile& file, const String& prefix); 00044 00047 RuleProcessor(const RuleProcessor& rule_processor); 00048 00051 ~RuleProcessor(); 00052 00055 void clear(); 00056 00059 void destroy(); 00060 00062 00065 00068 bool initialize(INIFile& file, const String& prefix); 00069 00071 00074 00077 const RuleProcessor& operator = (const RuleProcessor& rule_processor); 00078 00081 void set(const RuleProcessor& rule_processor); 00082 00084 00087 00090 virtual bool start(); 00091 00094 virtual bool finish(); 00095 00098 String evaluate(const Atom& atom); 00099 00101 00104 00106 bool isValid() const; 00107 00109 void dump(std::ostream& s = std::cout) const; 00110 00112 00113 protected: 00114 00115 //_ 00116 RuleEvaluator evaluator_; 00117 00118 //_ 00119 bool valid_; 00120 }; 00121 } // namespace BALL 00122 00123 00124 #endif // BALL_MOLMEC_COMMON_RULEPROCESSOR_H