World Ocean Simulation System (WOSS) library
woss::WossNetcdfDb Class Reference

NetCDF implementation of WossDb. More...

#include <woss-db.h>

Inheritance diagram for woss::WossNetcdfDb:
Inheritance graph
Collaboration diagram for woss::WossNetcdfDb:
Collaboration graph

Public Member Functions

 WossNetcdfDb (const std::string &name)
 
virtual ~WossNetcdfDb () override
 
virtual bool openConnection () override
 
virtual bool closeConnection () override
 
- Public Member Functions inherited from woss::WossDb
 WossDb (const std::string &name)
 
virtual ~WossDb ()=default
 
void setDbName (const std::string &pathname)
 
std::string getDbName () const
 
void setDebug (double flag=true)
 
bool isUsingDebug () const
 
virtual bool isValid () const
 
virtual bool finalizeConnection ()=0
 

Protected Attributes

std::unique_ptr< netCDF::NcFile > netcdf_db = nullptr
 
std::unique_ptr< NcFile > netcdf_db = nullptr
 
- Protected Attributes inherited from woss::WossDb
std::string db_name
 
bool debug
 

Additional Inherited Members

- Protected Member Functions inherited from woss::WossDb
PathName getPathName (const std::string &complete_path) const
 

Detailed Description

NetCDF implementation of WossDb.

WossNetcdfDb is the NetCDF specialization of WossDb class. It sets up connection to the file and properly initializes a NcFile* pointer. NetCDF variables however are not superimposed by this class. User has the task to correctly create and initialize them with the method finalizeConnection()

See also
BathyGebcoDb, SedimDeck41CoordDb, SedimDeck41MarsdenDb, SedimDeck41MarsdenOneDb, SspWoa2005Db

Constructor & Destructor Documentation

◆ WossNetcdfDb()

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

WossNetcdfDb constructor

Parameters
namepathname of database

◆ ~WossNetcdfDb()

WossNetcdfDb::~WossNetcdfDb ( )
overridevirtual

References closeConnection().

Here is the call graph for this function:

Member Function Documentation

◆ closeConnection()

bool WossNetcdfDb::closeConnection ( )
overridevirtual

Closes the connection to the NetCDF pathname provided

Returns
true if method was successful, false otherwise

Implements woss::WossDb.

References netcdf_db.

Referenced by woss::SedimDeck41Db::closeConnection(), and ~WossNetcdfDb().

◆ openConnection()

bool WossNetcdfDb::openConnection ( )
overridevirtual

Opens the connection to the NetCDF pathname provided

Returns
true if method was successful, false otherwise

Implements woss::WossDb.

References woss::WossDb::db_name, woss::WossDb::isValid(), and netcdf_db.

Here is the call graph for this function:

Member Data Documentation

◆ netcdf_db [1/2]

std::unique_ptr< netCDF::NcFile > woss::WossNetcdfDb::netcdf_db = nullptr
protected

◆ netcdf_db [2/2]

std::unique_ptr< NcFile> woss::WossNetcdfDb::netcdf_db = nullptr
protected

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