World Ocean Simulation System (WOSS) library
|
Abstract class that provides the interface of databases. More...
#include <woss-db.h>
Public Member Functions | |
WossDb (const ::std::string &name) | |
void | setDbName (const ::std::string &pathname) |
::std::string | getDbName () const |
void | setDebug (double flag=true) |
bool | isUsingDebug () const |
virtual bool | isValid () |
virtual bool | openConnection ()=0 |
virtual bool | finalizeConnection ()=0 |
virtual bool | closeConnection ()=0 |
Protected Member Functions | |
PathName | getPathName (const ::std::string &complete_path) |
Protected Attributes | |
::std::string | db_name |
bool | debug |
Abstract class that provides the interface of databases.
WossDb is the foundation of any database included in WOSS. It has the tasks of opening, setting up and closing a connection do a database. Technology dependant issues should be putted in a class that inherits from WossDb.No specific data behaviour is defined here, this will be provided in other abstract classes: this has been specifically done to divide db technology from data. A custom database would have to inherit from a technology dependant class and from a data behaviour class
WossDb::WossDb | ( | const ::std::string & | name | ) |
WossDb constructor
name | pathname of database |
|
pure virtual |
Closes the connection to the open database
Implemented in woss::ResPressureTxtDb, woss::ResTimeArrTxtDb, woss::SedimDeck41Db, woss::WossNetcdfDb, and woss::WossTextualDb.
|
pure virtual |
Post openConnection() actions. E.g. creating variables, initializing special pointers etc...
Implemented in woss::BathyGebcoDb, woss::BathyUtmCsvDb, woss::ResPressureTxtDb, woss::ResTimeArrTxtDb, woss::SedimDeck41CoordDb, woss::SedimDeck41Db, woss::SedimDeck41MarsdenDb, woss::SedimDeck41MarsdenOneDb, and woss::SspWoa2005Db.
Referenced by woss::WossDbCreator::initializeDb().
|
inline |
Gets the pathname (or custom network address) of database file
References db_name.
|
protected |
|
inline |
|
inlinevirtual |
Checks the validity of WossDb
Reimplemented in woss::SedimDeck41CoordDb, woss::SedimDeck41MarsdenDb, and woss::SedimDeck41MarsdenOneDb.
References db_name.
Referenced by woss::SedimDeck41CoordDb::isValid(), woss::SedimDeck41MarsdenDb::isValid(), woss::SedimDeck41MarsdenOneDb::isValid(), and woss::WossNetcdfDb::openConnection().
|
pure virtual |
Opens the connection to the pathname provided
Implemented in woss::SedimDeck41Db, woss::WossNetcdfDb, and woss::WossTextualDb.
Referenced by woss::WossDbCreator::initializeDb().
|
inline |
Sets the pathname (or custom network address) of database file
name | pathname database pathname |
References db_name.
Referenced by woss::SedimDeck41DbCreator::initializeSedimDb().
|
inline |
Sets debug flag
flag | debug flag |
References debug.
Referenced by woss::WossDbCreator::initializeDb().
|
protected |
Pathname to database. It could be a filesystem pathname, or a network identifier etc...
Referenced by getDbName(), woss::BathyUtmCsvDb::importData(), woss::ResPressureBinDb::importMap(), woss::ResPressureTxtDb::importMap(), woss::ResTimeArrBinDb::importMap(), woss::ResTimeArrTxtDb::importMap(), woss::SedimDeck41CoordDb::isValid(), woss::SedimDeck41MarsdenDb::isValid(), woss::SedimDeck41MarsdenOneDb::isValid(), isValid(), woss::WossNetcdfDb::openConnection(), woss::WossTextualDb::openConnection(), setDbName(), woss::ResPressureBinDb::writeMap(), woss::ResPressureTxtDb::writeMap(), woss::ResTimeArrBinDb::writeMap(), and woss::ResTimeArrTxtDb::writeMap().
|
protected |
Debug flag
Referenced by woss::SedimDeck41Db::calculateDeck41Types(), woss::SedimDeck41Db::calculateSediment(), woss::BathyGebcoDb::finalizeConnection(), woss::BathyGebcoDb::get1DBathyIndex(), woss::BathyGebcoDb::get2DBathyIndexes(), woss::BathyUtmCsvDb::getBathyIndex(), woss::SedimDeck41Db::getDeck41TypesFromCoords(), woss::SedimDeck41Db::getDeck41TypesFromMarsdenCoords(), woss::SedimDeck41Db::getDeck41TypesFromMarsdenSquare(), woss::SedimDeck41CoordDb::getSeaFloorType(), woss::SedimDeck41MarsdenDb::getSeaFloorType(), woss::SedimDeck41MarsdenOneDb::getSeaFloorType(), woss::SedimDeck41CoordDb::getSedimIndex(), woss::SedimDeck41CoordDb::getSedimIndexes(), woss::SspWoa2005Db::getSSPIndexes(), woss::SspWoa2005Db::getValue(), woss::BathyGebcoDb::getValue(), woss::BathyUtmCsvDb::getValue(), woss::BathyUtmCsvDb::importData(), woss::ResPressureBinDb::importMap(), woss::ResPressureTxtDb::importMap(), woss::ResTimeArrBinDb::importMap(), woss::ResTimeArrTxtDb::importMap(), woss::ResPressureTxtDb::insertValue(), woss::ResTimeArrTxtDb::insertValue(), isUsingDebug(), woss::ResTimeArrTxtDb::readMap(), and setDebug().