OBGlobalDataBase Class Reference

Base data table class, handles reading data files. More...

#include <data.h>

Inheritance diagram for OBGlobalDataBase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 OBGlobalDataBase ()
 Constructor.
virtual ~OBGlobalDataBase ()
 Destructor.
void Init ()
 Read in the data file, falling back as needed.
virtual unsigned int GetSize ()
 
Returns:
the size of the database (for error checking)

void SetReadDirectory (char *dir)
 Set the directory before calling Init().
void SetEnvironmentVariable (char *var)
 Set the environment variable to use before calling Init().
virtual void ParseLine (const char *)
 Specified by particular table classes (parses an individual data line).

Protected Attributes

bool _init
 whether the data been read already
const char * _dataptr
 default data table if file is unreadable
std::string _filename
 file to search for
std::string _dir
 data directory for file if _envvar fails
std::string _subdir
 subdirectory (if using environment variable)
std::string _envvar
 environment variable to check first

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")
  2. Checks for the directory _dir (def. determined by the build environment)
  3. Reverts to the compiled-in default data


Constructor & Destructor Documentation

OBGlobalDataBase (  )  [inline]

Constructor.

virtual ~OBGlobalDataBase (  )  [inline, virtual]

Destructor.


Member Function Documentation

void Init (  ) 

Read in the data file, falling back as needed.

virtual unsigned int GetSize (  )  [inline, virtual]

Returns:
the size of the database (for error checking)

Reimplemented in OBBondTyper, OBElementTable, OBIsotopeTable, OBTypeTable, OBResidueData, OBPhModel, OBRotorRules, OBAtomTyper, and OBAromaticTyper.

void SetReadDirectory ( char *  dir  )  [inline]

Set the directory before calling Init().

void SetEnvironmentVariable ( char *  var  )  [inline]

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

virtual void ParseLine ( const char *   )  [inline, virtual]

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

Reimplemented in OBBondTyper, OBElementTable, OBIsotopeTable, OBTypeTable, OBResidueData, OBPhModel, OBRotorRules, OBAtomTyper, and OBAromaticTyper.


Member Data Documentation

bool _init [protected]

whether the data been read already

const char* _dataptr [protected]

default data table if file is unreadable

std::string _filename [protected]

file to search for

std::string _dir [protected]

data directory for file if _envvar fails

std::string _subdir [protected]

subdirectory (if using environment variable)

std::string _envvar [protected]

environment variable to check first


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