World Ocean Simulation System (WOSS) library
woss::WossDb Class Referenceabstract

Abstract class that provides the interface of databases. More...

#include <woss-db.h>

Inheritance diagram for woss::WossDb:
Inheritance graph
Collaboration diagram for woss::WossDb:
Collaboration graph

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
 

Detailed Description

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

See also
WossBathymetryDb, WossSedimentDb, WossSSPDb, WossResArrDb, WossResPressDb

Constructor & Destructor Documentation

◆ WossDb()

WossDb::WossDb ( const ::std::string &  name)

WossDb constructor

Parameters
namepathname of database

Member Function Documentation

◆ closeConnection()

virtual bool woss::WossDb::closeConnection ( )
pure virtual

Closes the connection to the open database

Returns
true if method was successful, false otherwise

Implemented in woss::ResPressureTxtDb, woss::ResTimeArrTxtDb, woss::SedimDeck41Db, woss::WossNetcdfDb, and woss::WossTextualDb.

◆ finalizeConnection()

virtual bool woss::WossDb::finalizeConnection ( )
pure virtual

Post openConnection() actions. E.g. creating variables, initializing special pointers etc...

Returns
true if method was successful, false otherwise

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().

◆ getDbName()

::std::string woss::WossDb::getDbName ( ) const
inline

Gets the pathname (or custom network address) of database file

Returns
pathname database pathname

References db_name.

◆ getPathName()

PathName WossDb::getPathName ( const ::std::string &  complete_path)
protected

Gets path and database name separated

Returns
PathName value
See also
PathName

◆ isUsingDebug()

bool woss::WossDb::isUsingDebug ( ) const
inline

Gets debug flag

Returns
true if using debug, false otherwise

References debug.

◆ isValid()

virtual bool woss::WossDb::isValid ( )
inlinevirtual

◆ openConnection()

virtual bool woss::WossDb::openConnection ( )
pure virtual

Opens the connection to the pathname provided

Returns
true if method was successful, false otherwise

Implemented in woss::SedimDeck41Db, woss::WossNetcdfDb, and woss::WossTextualDb.

Referenced by woss::WossDbCreator::initializeDb().

◆ setDbName()

void woss::WossDb::setDbName ( const ::std::string &  pathname)
inline

Sets the pathname (or custom network address) of database file

Parameters
namepathname database pathname

References db_name.

Referenced by woss::SedimDeck41DbCreator::initializeSedimDb().

◆ setDebug()

void woss::WossDb::setDebug ( double  flag = true)
inline

Sets debug flag

Parameters
flagdebug flag

References debug.

Referenced by woss::WossDbCreator::initializeDb().

Member Data Documentation

◆ db_name

◆ debug


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