OEVectorBindings

class OEVectorBindings

This class represents OEVectorBindings.

The OEVectorBindings class is used to store a set of vector bindings or lexigraphic replacements that may appear in a SMARTS pattern.

A vector binding is a SMARTS pattern bound to a name. For example, the name [$HALO] can be used to represent the pattern [$(F,Cl,Br,I)] in order to make a pattern more human readable. The OEVectorBindings class converts SMARTS patterns written using vector bindings (human readable form) to the corresponding machine readable form by performing a name to pattern replacement.

Constructors

OEVectorBindings()
OEVectorBindings(const OEVectorBindings &)

Default and copy constructors.

operator=

OEVectorBindings &operator=(const OEVectorBindings &)

Add

bool Add(const char *label, const char *pattern)

Adds one vector binding to an OEVectorBindings object. The ‘label’ given as the first method argument is the name that appears in the human readable version of a SMARTS, while the ‘pattern’ given as the second method argument is the SMARTS that should be used to replace the ‘’label’‘. If the ‘pattern’ is parsed correctly and the association is made in the OEVectorBindings object, the method will return true. If the ‘pattern’ is invalid or the association cannot be made the method will return false. All attempts to associate a SMARTS pattern with a particular ‘label’ after the first association succeeds will result subsequent failures to create new associations.

Get

bool Get(const OEExprBase *&expr, const char *&label, const char *smarts) const

Retrieves the ‘label’ and corresponding OEExprBase pointer reference as the first and second method arguments, respectively, given a pointer to a position within a smarts string given as the final argument. If the ‘smarts’ string position points to the beginning of a vector bound ‘label’ contained in the OEVectorBindings object then the method will return true. If the vector binding cannot be identified then the method will return false.