Loading...
Searching...
No Matches
ruleEvaluator.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: ruleEvaluator.h,v 1.16 2005/12/23 17:01:52 amoll Exp $
//
// Molecular Mechanics: rule-based assignment of properties (typenames, charges, radii, etc.)
#ifndef BALL_MOLMEC_COMMON_RULEEVALUATOR_H
#define BALL_MOLMEC_COMMON_RULEEVALUATOR_H
#ifndef BALL_DATATYPE_STRINGHASHMAP_H
# include <BALL/DATATYPE/stringHashMap.h>
#endif
#ifndef BALL_KERNEL_EXPRESSION_H
# include <BALL/KERNEL/expression.h>
#endif
#include <list>
#include <utility>
namespace BALL
{
class INIFile;
class BALL_EXPORT RuleEvaluator
{
public:
BALL_CREATE(RuleEvaluator)
typedef std::list<std::pair<Expression, String> > RuleList;
typedef StringHashMap<RuleList> RuleMap;
RuleEvaluator() ;
RuleEvaluator(INIFile& file, const String& prefix) ;
RuleEvaluator(const RuleEvaluator& evaluator) ;
virtual ~RuleEvaluator() ;
bool initialize(INIFile& file, const String& prefix) ;
const String& getPrefix() const ;
void setPrefix(const String& prefix) ;
const RuleEvaluator& operator = (const RuleEvaluator& evaluator)
;
virtual void clear() ;
String operator () (const Atom& atom) const ;
bool operator == (const RuleEvaluator& evaluator) const ;
bool isValid() const ;
void dump(std::ostream& s = std::cout, Size indent_depth = 0) const
;
protected:
//_ parse the section with name: predicate_ + ":" + symbol of file
void extractSection_(INIFile& file, const String& symbol) ;
//_ The INI file section prefix
String prefix_;
//_ The map relating an element name and the corresponding list of expressions
RuleMap rule_map_;
//_
bool valid_;
};
} // namespace BALL
#endif // BALL_MOLMEC_COMMON_RULEEVALUATOR_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::Atom
Definition atom.h:90
BALL::Expression
Definition expression.h:80
BALL::INIFile
Definition INIFile.h:29
BALL::RuleEvaluator::extractSection_
void extractSection_(INIFile &file, const String &symbol)
BALL::RuleEvaluator::RuleList
std::list< std::pair< Expression, String > > RuleList
Definition ruleEvaluator.h:49
BALL::RuleEvaluator::dump
void dump(std::ostream &s=std::cout, Size indent_depth=0) const
BALL::RuleEvaluator::prefix_
String prefix_
Definition ruleEvaluator.h:144
BALL::RuleEvaluator::initialize
bool initialize(INIFile &file, const String &prefix)
BALL::RuleEvaluator::RuleEvaluator
RuleEvaluator()
BALL::RuleEvaluator::valid_
bool valid_
Definition ruleEvaluator.h:150
BALL::RuleEvaluator::rule_map_
RuleMap rule_map_
Definition ruleEvaluator.h:147
BALL::RuleEvaluator::RuleMap
StringHashMap< RuleList > RuleMap
Definition ruleEvaluator.h:53
BALL::RuleEvaluator::clear
virtual void clear()
BALL::RuleEvaluator::getPrefix
const String & getPrefix() const
BALL::RuleEvaluator::setPrefix
void setPrefix(const String &prefix)
BALL::RuleEvaluator::isValid
bool isValid() const
BALL::StringHashMap
Definition stringHashMap.h:42
BALL::String
Definition string.h:57
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
expression.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
std
STL namespace.
stringHashMap.h