Loading...
Searching...
No Matches
OBGlobalDataBase Class Reference

`#include <openbabel/data.h>`

Inheritance diagram for OBGlobalDataBase:
[legend]

## Public Member Functions

| OBGlobalDataBase ()
virtual | ~OBGlobalDataBase ()
void | Init ()
virtual size_t | GetSize ()
void | SetReadDirectory (char *dir)
void | SetEnvironmentVariable (char *var)
virtual void | ParseLine (const char *)

## Protected Attributes

bool | _init
const char * | _dataptr
std::string | _filename
std::string | _dir
std::string | _subdir
std::string | _envvar

## Detailed Description

Base data table class, handles reading data files.

Base data table class–reads ASCII data files in various formats

1. Checks for the environment variable _envvar (defaults to "BABEL_DATADIR")

- Tries the _subdir directory if defined (def. "data") and then the main directory

1. Checks for the directory _dir (def. determined by the build environment)

- Tries the subdirectory corresponding to this version, then the main directory

1. Reverts to the compiled-in default data

## Constructor & Destructor Documentation

## OBGlobalDataBase()

OBGlobalDataBase | ( |  | ) |

inline

Constructor.

## ~OBGlobalDataBase()

virtual ~OBGlobalDataBase | ( |  | ) |

inline virtual

Destructor.

## Member Function Documentation

## Init()

void Init | ( |  | ) |

Read in the data file, falling back as needed.

Referenced by OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBPhModel::AssignSeedPartialCharge(), OBAtomTyper::AssignTypes(), OBRingTyper::AssignTypes(), OBPhModel::CorrectForPH(), OBTypeTable::GetFromType(), OBRotorRules::GetRotorIncrements(), OBTypeTable::GetToType(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), OBTypeTable::Translate(), OBTypeTable::Translate(), and OBTypeTable::Translate().

## GetSize()

virtual size_t GetSize | ( |  | ) |

inline virtual

Returns
  the size of the database (for error checking)

Reimplemented in OBAtomicHeatOfFormationTable, OBAtomTyper, OBBondTyper, OBPhModel, OBResidueData, OBRingTyper, OBRotorRules, and OBTypeTable.

Referenced by Init().

## SetReadDirectory()

void SetReadDirectory | ( | char * | dir | ) |

inline

Set the directory before calling Init().

## SetEnvironmentVariable()

void SetEnvironmentVariable | ( | char * | var | ) |

inline

Set the environment variable to use before calling Init().

## ParseLine()

virtual void ParseLine | ( | const char * |  | ) |

inline virtual

Specified by particular table classes (parses an individual data line).

Reimplemented in OBAtomicHeatOfFormationTable, OBAtomTyper, OBBondTyper, OBPhModel, OBResidueData, OBRingTyper, OBRotorRules, and OBTypeTable.

Referenced by Init().

## Member Data Documentation

## _init

bool _init

protected

Whether the data been read already.

Referenced by OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBPhModel::AssignSeedPartialCharge(), OBAtomTyper::AssignTypes(), OBRingTyper::AssignTypes(), OBPhModel::CorrectForPH(), OBTypeTable::GetFromType(), OBRotorRules::GetRotorIncrements(), OBTypeTable::GetToType(), Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBGlobalDataBase(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), OBTypeTable::Translate(), OBTypeTable::Translate(), and OBTypeTable::Translate().

## _dataptr

const char* _dataptr

protected

Default data table if file is unreadable.

Referenced by Init(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBGlobalDataBase(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().

## _filename

std::string _filename

protected

File to search for.

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and OBRotorRules::SetFilename().

## _dir

std::string _dir

protected

Data directory for file if _envvar fails.

Referenced by OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and SetReadDirectory().

## _subdir

std::string _subdir

protected

Subdirectory (if using environment variable).

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().

## _envvar

std::string _envvar

protected

Environment variable to check first.

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and SetEnvironmentVariable().

The documentation for this class was generated from the following files:

- data.h
- data.cpp