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

WossDb for the custom made NetCDF WOA2005 SSP database. More...

#include <ssp-woa2005-db.h>

Inheritance diagram for woss::SspWoa2005Db:
Inheritance graph
Collaboration diagram for woss::SspWoa2005Db:
Collaboration graph

Public Member Functions

 SspWoa2005Db (const ::std::string &name)
 
 SspWoa2005Db (const ::std::string &name, WOADbType db_type)
 
virtual bool finalizeConnection ()
 
virtual bool insertValue (const Coord &coordinates, const Time &time_value, const SSP &ssp_value)
 
virtual SSPgetValue (const Coord &coordinates, const Time &time, long double ssp_depth_precision) const
 
WOADbType getWoaDbType () const
 
- Public Member Functions inherited from woss::WossNetcdfDb
 WossNetcdfDb (const ::std::string &name)
 
virtual bool openConnection ()
 
virtual bool closeConnection ()
 
- Public Member Functions inherited from woss::WossDb
 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 ()
 

Protected Member Functions

SSPIndexes getSSPIndexes (const Coord &coordinates) const
 
void getSSPValue (const Coord &coordinates, const SSPIndexes &indexes, double ssp_values[]) const
 
void getSSPValue (const SSPIndexes &indexes, double ssp_values[]) const
 
- Protected Member Functions inherited from woss::WossDb
PathName getPathName (const ::std::string &complete_path)
 

Protected Attributes

WOADbType woa_db_type
 
netCDF::NcVar ssp_var
 
NcVar * ssp_var
 
netCDF::NcVar lat_var
 
netCDF::NcVar lon_var
 
- Protected Attributes inherited from woss::WossNetcdfDb
netCDF::NcFile * netcdf_db
 
NcFile * netcdf_db
 
- Protected Attributes inherited from woss::WossDb
::std::string db_name
 
bool debug
 

Detailed Description

WossDb for the custom made NetCDF WOA2005 SSP database.

WossDb for the custom made NetCDF WOA2005 SSP database

Constructor & Destructor Documentation

◆ SspWoa2005Db() [1/2]

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

SspWoa2005Db constructor

Parameters
namepathname of database

References woss::WOA_DB_TYPE_2005.

◆ SspWoa2005Db() [2/2]

SspWoa2005Db::SspWoa2005Db ( const ::std::string &  name,
WOADbType  db_type 
)

SspWoa2005Db constructor

Parameters
namepathname of database
db_typeWOADbType of the database

Member Function Documentation

◆ finalizeConnection()

bool SspWoa2005Db::finalizeConnection ( )
virtual

Post openConnection() actions, used to create and initialize NetCDF variables

Returns
true if method was successful, false otherwise

Implements woss::WossDb.

References lat_var, lon_var, woss::WossNetcdfDb::netcdf_db, ssp_var, woa_db_type, woss::WOA_DB_TYPE_2005, and woss::WOA_DB_TYPE_2013.

◆ getSSPIndexes()

SSPIndexes SspWoa2005Db::getSSPIndexes ( const Coord coordinates) const
protected

Returns the indexes used by the NetCDF variable to get the SSP values

Parameters
coordinatesconst reference to a valid Coord object
Returns
SSPIndexes value

References woss::WossDb::debug, woss::Coord::getLatitude(), woss::Coord::getLongitude(), woa_db_type, woss::WOA_DB_TYPE_2005, and woss::WOA_DB_TYPE_2013.

Referenced by getValue().

Here is the call graph for this function:

◆ getSSPValue() [1/2]

void SspWoa2005Db::getSSPValue ( const Coord coordinates,
const SSPIndexes indexes,
double  ssp_values[] 
) const
protected

Insert the SSP values taken from the given indexes into the given array

Parameters
coordinatesconst reference to a valid Coord object
indexesconst reference to a valid SSPIndexes object
ssp_values[]array that will hold SSP values

References woss::WOA_DB_TYPE_2005, and woss::WOA_DB_TYPE_2013.

Referenced by getValue().

◆ getSSPValue() [2/2]

void woss::SspWoa2005Db::getSSPValue ( const SSPIndexes indexes,
double  ssp_values[] 
) const
protected

Insert the SSP values taken from the given indexes into the given array

Parameters
indexesconst reference to a valid SSPIndexes object
ssp_values[]array that will hold SSP values

◆ getValue()

SSP * SspWoa2005Db::getValue ( const Coord coordinates,
const Time time,
long double  ssp_depth_precision 
) const
virtual

Returns a pointer to a heap-based SSP for given coordinates and date time if both present in the database. User is responsible of pointer's ownership

Parameters
coordsconst reference to a valid Coord object
timeconst reference to a valid Time object
ssp_depth_precisionssp depth precision [m]
Returns
valid SSP if coordinates and time date are found, not valid otherwise

Implements woss::WossSSPDb.

References woss::WossDb::debug, getSSPIndexes(), getSSPValue(), and woss::Singleton< T >::instance().

Here is the call graph for this function:

◆ getWoaDbType()

WOADbType woss::SspWoa2005Db::getWoaDbType ( ) const
inline

Returns current WOADbType

Returns
current WOADbType

References woa_db_type.

◆ insertValue()

bool SspWoa2005Db::insertValue ( const Coord coordinates,
const Time time_value,
const SSP ssp_value 
)
virtual

Inserts the given woss::SSP value in the database for given coordinates

Parameters
coordinatesconst reference to a valid Coord object
time_valueconst reference to a valid Time object
ssp_valueconst Reference to SSP value to be inserted
Returns
true if method was successful, false otherwise

Implements woss::WossSSPDb.

Member Data Documentation

◆ lat_var

netCDF::NcVar woss::SspWoa2005Db::lat_var
protected

NetCDF variable representing latitude

Referenced by finalizeConnection().

◆ lon_var

netCDF::NcVar woss::SspWoa2005Db::lon_var
protected

NetCDF variable representing longitude

Referenced by finalizeConnection().

◆ ssp_var

netCDF::NcVar woss::SspWoa2005Db::ssp_var
protected

NetCDF variable representing SSP

Referenced by finalizeConnection().

◆ woa_db_type

WOADbType woss::SspWoa2005Db::woa_db_type
protected

WOA Db type

Referenced by finalizeConnection(), getSSPIndexes(), and getWoaDbType().


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