19 #ifndef OB_DESCRIPTOR_H 20 #define OB_DESCRIPTOR_H 26 #include <openbabel/babelconfig.h> 39 const char*
TypeID(){
return "descriptors";};
43 {
return std::numeric_limits<double>::quiet_NaN();}
46 double PredictAndSave(
OBBase* pOb, std::string* param=NULL);
49 virtual double GetStringValue(
OBBase* pOb, std::string& svalue, std::string* param=NULL);
52 virtual bool Compare(
OBBase* pOb, std::istream& ss,
bool noEval, std::string* param=NULL);
57 virtual bool Display(std::string& txt,
const char* param,
const char* ID=NULL);
61 virtual bool Order(
double p1,
double p2){
return p1<p2; }
62 virtual bool Order(std::string s1, std::string s2){
return s1<s2; }
65 static bool FilterCompare(
OBBase* pOb, std::istream& ss,
bool noEval);
68 static void AddProperties(
OBBase* pOb,
const std::string& DescrList);
71 static void DeleteProperties(
OBBase* pOb,
const std::string& DescrList);
75 static std::string GetValues(
OBBase* pOb,
const std::string& DescrList);
78 static std::pair<std::string, std::string> GetIdentifier(std::istream& optionText);
82 static double ParsePredicate(std::istream& optionText,
char& ch1,
char& ch2, std::string& svalue);
86 static bool ReadStringFromFilter(std::istream& ss, std::string& result);
90 static bool CompareStringWithFilter(std::istream& optionText, std::string& s,
bool noEval,
bool NoCompOK=
false);
95 return ispunct(ch) && ch!=
'_' && ch!=
'$' && ch!=
'#' && ch!=
'%';
99 static bool MatchPairData(
OBBase* pOb, std::string& s);
109 return val==filterval;
111 return val!=filterval;
114 return val>=filterval;
116 return val>filterval;
119 return val<=filterval;
121 return val<filterval;
Definition: residue.h:336
static bool ispunctU(char ch)
Definition: descriptor.h:93
Base class for all types of dynamic classes discovered at runtime.
Definition: plugin.h:52
static bool DoComparison(char ch1, char ch2, T &val, T &filterval)
Definition: descriptor.h:103
virtual bool Order(std::string s1, std::string s2)
Definition: descriptor.h:62
#define MAKE_PLUGIN(BaseClass)
Definition: plugin.h:195
Simplify 'plugin' classes to be discovered and/or loaded at runtime.
virtual bool Order(double p1, double p2)
Definition: descriptor.h:61
const char * TypeID()
Redefined by each plugin type: "formats", "fingerprints", etc.
Definition: descriptor.h:39
virtual double Predict(OBBase *, std::string *=NULL)
Definition: descriptor.h:42
Base class for molecular properties, descriptors or features.
Definition: descriptor.h:34
Base Class.
Definition: base.h:239
Global namespace for all Open Babel code.
Definition: alias.h:22