Open Babel  3.0
Public Member Functions | Protected Attributes | List of all members
OBGlobalDataBase Class Reference

#include <openbabel/data.h>

Inheritance diagram for OBGlobalDataBase:
OBAtomicHeatOfFormationTable OBAtomTyper OBBondTyper OBPhModel OBResidueData OBRingTyper OBRotorRules OBTypeTable

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

Constructor & Destructor Documentation

◆ OBGlobalDataBase()

OBGlobalDataBase ( )
inline

Constructor.

◆ ~OBGlobalDataBase()

virtual ~OBGlobalDataBase ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ Init()

void Init ( )

Read in the data file, falling back as needed.

Referenced by OBRotorList::Init().

◆ GetSize()

virtual size_t GetSize ( )
inlinevirtual
Returns
the size of the database (for error checking)

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

◆ 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 *  )
inlinevirtual

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

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

Member Data Documentation

◆ _init

bool _init
protected

Whether the data been read already.

◆ _dataptr

const char* _dataptr
protected

Default data table if file is unreadable.

◆ _filename

std::string _filename
protected

File to search for.

◆ _dir

std::string _dir
protected

Data directory for file if _envvar fails.

◆ _subdir

std::string _subdir
protected

Subdirectory (if using environment variable)

◆ _envvar

std::string _envvar
protected

Environment variable to check first.


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