Generic Data

From Open Babel
Revision as of 18:28, 18 July 2006 by Ghutchis (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The OBGenericData class and its subclasses are mechanisms for storing arbitrary data inside an atom, a bond, a residue, a molecule -- almost any object in Open Babel.

Two key points are needed when discussing generic data classes. Accessing generic data can occur by two different mechanisms:

  • String attributes
  • Integer type keys

Generic data is stored internally as an array/vector, so access to a particular key is faster through use of the integer type, defined in the OBGenericDataType namespace. However, arbitrary string keys can be specified, particularly with the OBPairData class, which is designed for assigning textual key/value pairs.