Generic Data

From Open Babel
Revision as of 14:49, 19 October 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.

Defined Attribute Keys

Currently defined text attribute keys by the Open Babel library include:

  • Comment
  • Conformers
  • ExternalBondData
  • PairData
  • Symmetry
  • UnitCell
  • UndefinedData
  • VirtualBondData

Defined Type Keys

Current OBGenericDataType integer keys are defined in the API documentation.