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

Abstraction layer for database and data manipulation. More...

#include <woss-db-manager.h>

Collaboration diagram for woss::WossDbManager:
Collaboration graph

Classes

class  BearingOperator
 Bearing operator function object. More...
 
class  RangeOperator
 Range operator function object. More...
 

Public Types

using CCBathymetry = CustomDataContainer< Coord, BearingOperator, RangeOperator, Bathymetry >
 
using CCSSP = CustomDataTimeContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr< SSP > >
 
using CCSediment = CustomDataContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr< Sediment > >
 
using CCAltimetry = CustomDataContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr< Altimetry > >
 

Public Member Functions

 WossDbManager ()
 
 WossDbManager (const WossDbManager &instance)=default
 
 WossDbManager (WossDbManager &&instance)=default
 
WossDbManageroperator= (const WossDbManager &instance)=default
 
WossDbManageroperator= (WossDbManager &&instance)=default
 
virtual ~WossDbManager ()=default
 
virtual std::unique_ptr< AltimetrygetAltimetry (const CoordZ &tx, const CoordZ &rx) const
 
virtual std::unique_ptr< SedimentgetSediment (const CoordZ &tx, const CoordZ &rx) const
 
virtual std::unique_ptr< SedimentgetSediment (const CoordZ &tx, const CoordZVector &rx_coordz_vector) const
 
virtual Bathymetry getBathymetry (const Coord &tx, const Coord &rx) const
 
virtual void getBathymetry (const Coord &tx, CoordZVector &rx_coordz_vector) const
 
virtual std::unique_ptr< SSPgetSSP (const Coord &tx, const Coord &rx, const Time &time, long double ssp_depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
 
virtual std::unique_ptr< SSPgetAverageSSP (const Coord &tx, const Coord &rx, const Time &time_start, const Time &time_end, int max_time_values, long double ssp_depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
 
virtual std::unique_ptr< TimeArrgetTimeArr (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const
 
virtual void insertTimeArr (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const TimeArr &channel) const
 
virtual std::unique_ptr< PressuregetPressure (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const
 
virtual void insertPressure (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const Pressure &pressure) const
 
WossDbManagersetBathymetryDb (std::unique_ptr< WossBathymetryDb > ptr)
 
WossDbManagersetSedimentDb (std::unique_ptr< WossSedimentDb > ptr)
 
WossDbManagersetSSPDb (std::unique_ptr< WossSSPDb > ptr)
 
WossDbManagersetResTimeArrDb (std::unique_ptr< WossResTimeArrDb > ptr)
 
WossDbManagersetResPressureDb (std::unique_ptr< WossResPressDb > ptr)
 
bool setCustomAltimetry (const Altimetry &altimetry, const Coord &tx_coord=CCAltimetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCAltimetry::DB_CDATA_ALL_INNER_KEYS)
 
std::unique_ptr< AltimetrygetCustomAltimetry (const Coord &tx_coord=CCAltimetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCAltimetry::DB_CDATA_ALL_INNER_KEYS) const
 
WossDbManagereraseCustomAltimetry (const Coord &tx_coord=CCAltimetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCAltimetry::DB_CDATA_ALL_INNER_KEYS)
 
bool setCustomSediment (const Sediment &sediment, const Coord &tx_coord=CCSediment::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSediment::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSediment::DB_CDATA_ALL_INNER_KEYS)
 
bool setCustomSediment (const std::string &sediment_string, const Coord &txCoord=CCSediment::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSediment::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSediment::DB_CDATA_ALL_INNER_KEYS)
 
std::unique_ptr< SedimentgetCustomSediment (const Coord &tx_coord=CCSediment::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSediment::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSediment::DB_CDATA_ALL_INNER_KEYS) const
 
WossDbManagereraseCustomSediment (const Coord &tx_coord=CCSediment::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSediment::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSediment::DB_CDATA_ALL_INNER_KEYS)
 
bool setCustomSSP (const SSP &ssp, const Coord &tx_coord=CCSSP::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSSP::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSSP::DB_CDATA_ALL_INNER_KEYS, const Time &time_value=CCSSP::DB_CDATA_ALL_TIME_KEYS)
 
bool setCustomSSP (const std::string &sspString, const Coord &txCoord=CCSSP::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSSP::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSSP::DB_CDATA_ALL_INNER_KEYS, const Time &time_value=CCSSP::DB_CDATA_ALL_TIME_KEYS)
 
virtual bool importCustomSSP (const std::string &filename, const Time &=CCSSP::DB_CDATA_ALL_TIME_KEYS, const Coord &tx_coord=CCSSP::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSSP::DB_CDATA_ALL_MEDIUM_KEYS)
 
std::unique_ptr< SSPgetCustomSSP (const Coord &tx_coord=CCSSP::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSSP::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSSP::DB_CDATA_ALL_INNER_KEYS, const Time &time_value=CCSSP::DB_CDATA_ALL_TIME_KEYS) const
 
WossDbManagereraseCustomSSP (const Coord &tx_coord=CCSSP::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCSSP::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCSSP::DB_CDATA_ALL_INNER_KEYS, const Time &time_value=CCSSP::DB_CDATA_ALL_TIME_KEYS)
 
bool setCustomBathymetry (const Bathymetry &bathymetry, const Coord &tx_coord=CCBathymetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCBathymetry::DB_CDATA_ALL_INNER_KEYS)
 
bool setCustomBathymetry (const std::string &bathyLine, const Coord &tx_coord=CCBathymetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS)
 
virtual bool importCustomBathymetry (const std::string &filename, const Coord &tx_coord=CCBathymetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS)
 
Bathymetry getCustomBathymetry (const Coord &tx_coord=CCBathymetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCBathymetry::DB_CDATA_ALL_INNER_KEYS) const
 
WossDbManagereraseCustomBathymetry (const Coord &tx_coord=CCBathymetry::DB_CDATA_ALL_OUTER_KEYS, double bearing=CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS, double range=CCBathymetry::DB_CDATA_ALL_INNER_KEYS)
 
WossDbManagersetDebug (bool flag)
 
bool getDebug () const
 

Protected Member Functions

virtual bool closeAllConnections ()
 
virtual void updateDebugFlag ()
 

Protected Attributes

std::unique_ptr< WossBathymetryDbbathymetry_db
 
std::unique_ptr< WossSedimentDbsediment_db
 
std::unique_ptr< WossSSPDbssp_db
 
std::unique_ptr< WossResTimeArrDbresults_arrivals_db
 
std::unique_ptr< WossResPressDbresults_pressure_db
 
bool debug
 
CCBathymetry ccbathy_map
 
CCSediment ccsediment_map
 
CCSSP ccssp_map
 
CCAltimetry ccaltimetry_map
 

Detailed Description

Abstraction layer for database and data manipulation.

WossDbManager has the exclusive handling of all databases involved. No other object can access directly to a WossDb entity. Thanks to the abstraction provided, WossDbManager can perform arithmetic and other data manipulation. It should be used with woss::Singleton for safety reasons. ( e.g. woss::Singleton<woss::WossDbManager> ) WossDbManager also provides a way to generate environmental data on the fly. Providing a generator coordinate and a set of bearing and ranges, the user can create all sort of polygon where the given environmental data is valid.

See also
setCustom* methods, command

Member Typedef Documentation

◆ CCAltimetry

◆ CCBathymetry

◆ CCSediment

◆ CCSSP

Constructor & Destructor Documentation

◆ WossDbManager() [1/3]

WossDbManager::WossDbManager ( )

Default constructor

References updateDebugFlag().

Here is the call graph for this function:

◆ WossDbManager() [2/3]

woss::WossDbManager::WossDbManager ( const WossDbManager instance)
default

◆ WossDbManager() [3/3]

woss::WossDbManager::WossDbManager ( WossDbManager &&  instance)
default

◆ ~WossDbManager()

virtual woss::WossDbManager::~WossDbManager ( )
virtualdefault

Destructor. It deletes all pointers involved. Derived classes don't have to do it

Member Function Documentation

◆ closeAllConnections()

bool WossDbManager::closeAllConnections ( )
protectedvirtual

Closes all connections of owned databases

References bathymetry_db, results_arrivals_db, results_pressure_db, sediment_db, and ssp_db.

◆ eraseCustomAltimetry()

WossDbManager & woss::WossDbManager::eraseCustomAltimetry ( const Coord tx_coord = CCAltimetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCAltimetry::DB_CDATA_ALL_INNER_KEYS 
)
inline

Erases the custom Altimetry for given parameters

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
reference to *this

References ccaltimetry_map, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::erase().

Here is the call graph for this function:

◆ eraseCustomBathymetry()

WossDbManager & woss::WossDbManager::eraseCustomBathymetry ( const Coord tx_coord = CCBathymetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCBathymetry::DB_CDATA_ALL_INNER_KEYS 
)
inline

Erases the custom Bathymetry for given parameters

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
reference to *this

References ccbathy_map, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::erase().

Here is the call graph for this function:

◆ eraseCustomSediment()

WossDbManager & woss::WossDbManager::eraseCustomSediment ( const Coord tx_coord = CCSediment::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSediment::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSediment::DB_CDATA_ALL_INNER_KEYS 
)
inline

Erases the custom Sediment for given parameters

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
reference to *this

References ccsediment_map, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::erase().

Here is the call graph for this function:

◆ eraseCustomSSP()

WossDbManager & woss::WossDbManager::eraseCustomSSP ( const Coord tx_coord = CCSSP::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSSP::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSSP::DB_CDATA_ALL_INNER_KEYS,
const Time time_value = CCSSP::DB_CDATA_ALL_TIME_KEYS 
)
inline

Erases the custom SSP for given parameters

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
time_valueconst reference to a valid Time object
Returns
reference to *this

References ccssp_map, and woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::erase().

Here is the call graph for this function:

◆ getAltimetry()

std::unique_ptr< Altimetry > WossDbManager::getAltimetry ( const CoordZ tx,
const CoordZ rx 
) const
virtual

Returns a std::unique_ptr to a heap-created Altimetry value for given coordinates and depth, if present in the Altimetry database. User is responsible of pointer's ownership

Parameters
coordsconst reference to a valid CoordZ object
Returns
std::unique_ptr to a valid Altimetry if coordinates are found, not valid otherwise

References ccaltimetry_map, woss::Altimetry::createNotValid(), debug, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), woss::Singleton< T >::instance(), and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::size().

Here is the call graph for this function:

◆ getAverageSSP()

std::unique_ptr< SSP > WossDbManager::getAverageSSP ( const Coord tx,
const Coord rx,
const Time time_start,
const Time time_end,
int  max_time_values,
long double  ssp_depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
) const
virtual

Returns a std::unique_ptr to a heap-created average SSP for given coordinates, start and end time date if they are present in the database. User is responsible of pointer's ownership

Parameters
coordsconst reference to a valid Coord object
time_startconst reference to a valid Time object
time_endconst reference to a valid Time object
max_time_valuestotal number of Time to take between time_start and time_end
ssp_depth_precisionreturned SSP's depth precision
Returns
a std::unique_ptr to a valid SSP if coordinates and both time date are found, not valid otherwise

References ccssp_map, woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::empty(), woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), woss::Singleton< T >::instance(), and ssp_db.

Here is the call graph for this function:

◆ getBathymetry() [1/2]

Bathymetry WossDbManager::getBathymetry ( const Coord tx,
const Coord rx 
) const
virtual

Returns the positive depth value ( bathymetry ) of given coordinates, if present in the database

Parameters
coordsconst reference to a valid Coord object
Returns
positive depth value [m] if coordinates are found, HUGE_VAL otherwise

References bathymetry_db, ccbathy_map, debug, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::empty(), woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::size().

Referenced by getBathymetry().

Here is the call graph for this function:

◆ getBathymetry() [2/2]

void WossDbManager::getBathymetry ( const Coord tx,
CoordZVector rx_coordz_vector 
) const
virtual

Sets the positive depth for each CoordZ present in the vector, HUGE_VAL is set if coordinates are not present in the database

Parameters
coordsreference to a CoordZVector

References getBathymetry().

Here is the call graph for this function:

◆ getCustomAltimetry()

std::unique_ptr< Altimetry > woss::WossDbManager::getCustomAltimetry ( const Coord tx_coord = CCAltimetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCAltimetry::DB_CDATA_ALL_INNER_KEYS 
) const
inline

Gets the custom Altimetry for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
std::unique_ptr to an Altimetry value. The object will be not valid if the input is not found

References ccaltimetry_map, woss::Altimetry::createNotValid(), woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), and woss::Singleton< T >::instance().

Here is the call graph for this function:

◆ getCustomBathymetry()

Bathymetry woss::WossDbManager::getCustomBathymetry ( const Coord tx_coord = CCBathymetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCBathymetry::DB_CDATA_ALL_INNER_KEYS 
) const
inline

Gets the custom Bathymetry for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
std::unique_ptr to an Altimetry value. The object will be not valid if the input is not found

References ccbathy_map, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get().

Here is the call graph for this function:

◆ getCustomSediment()

std::unique_ptr< Sediment > woss::WossDbManager::getCustomSediment ( const Coord tx_coord = CCSediment::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSediment::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSediment::DB_CDATA_ALL_INNER_KEYS 
) const
inline

Gets the custom Sediment for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
std::unique_ptr to a Sediment value. The object will be not valid if the input is not found

References ccsediment_map, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), and woss::Singleton< T >::instance().

Here is the call graph for this function:

◆ getCustomSSP()

std::unique_ptr< SSP > woss::WossDbManager::getCustomSSP ( const Coord tx_coord = CCSSP::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSSP::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSSP::DB_CDATA_ALL_INNER_KEYS,
const Time time_value = CCSSP::DB_CDATA_ALL_TIME_KEYS 
) const
inline

Gets the custom SSP for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
time_valueconst reference to a valid Time object
Returns
std::unique_ptr to an SSP value. The object will be not valid if the input is not found

References ccssp_map, woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), and woss::Singleton< T >::instance().

Here is the call graph for this function:

◆ getDebug()

bool woss::WossDbManager::getDebug ( ) const
inline

References debug.

◆ getPressure()

std::unique_ptr< Pressure > WossDbManager::getPressure ( const CoordZ coord_tx,
const CoordZ coord_rx,
const double  frequency,
const Time time_value 
) const
virtual

Returns a std::unique_ptr to a heap-created Pressure value of given frequency, transmitter and receiver coordinates if present in the database. User is responsible of pointer's ownership

Parameters
coord_txconst reference to a valid CoordZ object
coord_rxconst reference to a valid CoordZ object
frequencyused frequency [hz]
time_valueconst reference to a valid Time object
Returns
std::unique_ptr to a valid Pressure if parameters are found, not valid otherwise

References woss::Pressure::createNotValid(), woss::Singleton< T >::instance(), and results_pressure_db.

Here is the call graph for this function:

◆ getSediment() [1/2]

std::unique_ptr< Sediment > WossDbManager::getSediment ( const CoordZ tx,
const CoordZ rx 
) const
virtual

Returns a std::unique_ptr to a heap-created Sediment value for given coordinates and depth, if present in the Sediment database. User is responsible of pointer's ownership

Parameters
coordsconst reference to a valid CoordZ object
Returns
std::unique_ptr to a valid Sediment if coordinates are found, not valid otherwise

References ccsediment_map, debug, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::empty(), woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), woss::Singleton< T >::instance(), sediment_db, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::size().

Referenced by getSediment().

Here is the call graph for this function:

◆ getSediment() [2/2]

std::unique_ptr< Sediment > WossDbManager::getSediment ( const CoordZ tx,
const CoordZVector rx_coordz_vector 
) const
virtual

Returns the std::unique_ptr to a Sediment value of given coordinates and depth vector, if at least one set of coordinates is present in the Sediment database. User is responsible of pointer's ownership

Parameters
coordz_vectorconst reference to a valid CoordZ vector
Returns
std::unique_ptr to a valid Sediment if at least one set of coordinates is found, not valid otherwise

References ccsediment_map, debug, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::empty(), getSediment(), woss::Singleton< T >::instance(), and sediment_db.

Here is the call graph for this function:

◆ getSSP()

std::unique_ptr< SSP > WossDbManager::getSSP ( const Coord tx,
const Coord rx,
const Time time,
long double  ssp_depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
) const
virtual

Returns the SSP value of 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
a std::unique_ptr to a valid SSP if coordinates are found, not valid otherwise

References ccssp_map, woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::empty(), woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::get(), woss::Singleton< T >::instance(), and ssp_db.

Here is the call graph for this function:

◆ getTimeArr()

std::unique_ptr< TimeArr > WossDbManager::getTimeArr ( const CoordZ coord_tx,
const CoordZ coord_rx,
const double  frequency,
const Time time_value 
) const
virtual

Returns a std::unique_ptr to a heap-created TimeArr value of given frequency, transmitter and receiver coordinates if present in the database. User is responsible of pointer's ownership

Parameters
coord_txconst reference to a valid CoordZ object
coord_rxconst reference to a valid CoordZ object
frequencyused frequency [hz]
time_valueconst reference to a valid Time object
Returns
std::unique_ptr to a valid TimeArr if parameters are found, not valid otherwise

References woss::TimeArr::createNotValid(), woss::Singleton< T >::instance(), and results_arrivals_db.

Here is the call graph for this function:

◆ importCustomBathymetry()

bool WossDbManager::importCustomBathymetry ( const std::string &  filename,
const Coord tx_coord = CCBathymetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS 
)
virtual

Imports a CustomBathymetry from file. The file has to be a two column format: Range [m] Depth [m]

Parameters
filenameconst reference to a string
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
Returns
true if import was successful, false otherwise

References ccbathy_map, and debug.

◆ importCustomSSP()

bool WossDbManager::importCustomSSP ( const std::string &  filename,
const Time time = CCSSP::DB_CDATA_ALL_TIME_KEYS,
const Coord tx_coord = CCSSP::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSSP::DB_CDATA_ALL_MEDIUM_KEYS 
)
virtual

Imports a CustomSSP from file.
File format:

  • first line: type name.
  • second line: latitude for depth and pressure correction purposes
  • third line: longitude for depth and pressure correction purposes

Following format depends on type name:

  • "SSP" : three columns. range [m] | depth [m] | sound speed [m/s]
  • "FULL" : six columns. range [m] | depth [m] | temperature [C°] | salinity [ppu] | pressure [bar] | sound speed [m/s]
  • "TEMPERATURE_SALINITY_PRESSURE" : four columns. range [m] | temperature [C°] | salinity [ppu] | pressure [bar]
  • "DEPTH_TEMPERATURE_SALINITY" : four columns. range [m] | depth [m] | temperature [C°] | salinity [ppu]
Parameters
filenameconst reference to a string
timeconst reference to a valid Time object
tx_coordconst reference to a valid Coord object (originator coordinates)
bearingbearing value [radians]
Returns
true is import was completed succesfully, false otherwise

References ccssp_map, woss::CustomDataTimeContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr< SSP > >::DB_CDATA_ALL_INNER_KEYS, debug, woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::insert(), and woss::Singleton< T >::instance().

Here is the call graph for this function:

◆ insertPressure()

void WossDbManager::insertPressure ( const CoordZ coord_tx,
const CoordZ coord_rx,
const double  frequency,
const Time time_value,
const Pressure pressure 
) const
virtual

Inserts the given Pressure value in the database at given frequency, transmitter and receiver coordinates

Parameters
coord_txconst reference to a valid CoordZ object
coord_rxconst reference to a valid CoordZ object
frequencyused frequency [hz]
time_valueconst reference to a valid Time object
channelcomputed Pressure

References results_pressure_db.

◆ insertTimeArr()

void WossDbManager::insertTimeArr ( const CoordZ coord_tx,
const CoordZ coord_rx,
const double  frequency,
const Time time_value,
const TimeArr channel 
) const
virtual

Inserts a given TimeArr value in the database at given frequency, transmitter and receiver coordinates

Parameters
coord_txconst reference to a valid CoordZ object
coord_rxconst reference to a valid CoordZ object
frequencyused frequency [hz]
time_valueconst reference to a valid Time object
channelcomputed TimeArr

References results_arrivals_db.

◆ operator=() [1/2]

WossDbManager & woss::WossDbManager::operator= ( const WossDbManager instance)
default

◆ operator=() [2/2]

WossDbManager & woss::WossDbManager::operator= ( WossDbManager &&  instance)
default

◆ setBathymetryDb()

WossDbManager & woss::WossDbManager::setBathymetryDb ( std::unique_ptr< WossBathymetryDb ptr)
inline

Initializes the bathymetry database pointer. WossDbManager takes the ownership of the Db.

Parameters
ptrvalid std::unique_ptr WossBathymetryDb
Returns
reference to *this

References bathymetry_db.

◆ setCustomAltimetry()

bool woss::WossDbManager::setCustomAltimetry ( const Altimetry altimetry,
const Coord tx_coord = CCAltimetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCAltimetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCAltimetry::DB_CDATA_ALL_INNER_KEYS 
)
inline

Sets the custom Altimetry for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
true if method succed, false otherwise

References ccaltimetry_map, woss::Altimetry::clone(), and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::insert().

Here is the call graph for this function:

◆ setCustomBathymetry() [1/2]

bool woss::WossDbManager::setCustomBathymetry ( const Bathymetry bathymetry,
const Coord tx_coord = CCBathymetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCBathymetry::DB_CDATA_ALL_INNER_KEYS 
)
inline

Sets the custom Bathymetry for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
if insertion succeed, the function returns a nullptr pointer, that needs to be initialized. if an object was already instantiated, the function returns the pointer to it;

References ccbathy_map, and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::insert().

Referenced by setCustomBathymetry().

Here is the call graph for this function:

◆ setCustomBathymetry() [2/2]

bool WossDbManager::setCustomBathymetry ( const std::string &  bathyLine,
const Coord tx_coord = CCBathymetry::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCBathymetry::DB_CDATA_ALL_MEDIUM_KEYS 
)

Reads the input std::string and converts it into a custom woss::Bathymetry object and binds it to the input geometry

Parameters
bathyLinebathymetry in string format. syntax:
  • tot_ranges|range_1[m]|dept_1[n]|....|range_final[m]|depth_final[m]
txCoordthe geometry originating geographical coordinates
bearingthe geometry bearing [radians]
Returns
true if successful, false otherwise

References debug, and setCustomBathymetry().

Here is the call graph for this function:

◆ setCustomSediment() [1/2]

bool woss::WossDbManager::setCustomSediment ( const Sediment sediment,
const Coord tx_coord = CCSediment::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSediment::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSediment::DB_CDATA_ALL_INNER_KEYS 
)
inline

Sets the custom Sediment for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
Returns
if insertion succeed, the function returns a nullptr pointer, that needs to be initialized. if an object was already instantiated, the function returns the pointer to it;

References ccsediment_map, woss::Sediment::clone(), and woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::insert().

Referenced by setCustomSediment().

Here is the call graph for this function:

◆ setCustomSediment() [2/2]

bool WossDbManager::setCustomSediment ( const std::string &  sediment_string,
const Coord txCoord = CCSediment::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSediment::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSediment::DB_CDATA_ALL_INNER_KEYS 
)

Converts the input :std::string into a woss::Sediment object and binds it to the designed geometry.

Parameters
sediment_stringSSP in string format. syntax:
  • Sed_typename|SSP[m/s]|vel_c[m/s]|vel_s[m/s]|dens[g/cm^3]|att_c[db/wavelength]|att_s[db/wavelength]|bottom_depth[m]
txCoordthe geometry originating geographical coordinates
bearingthe geometry bearing [radians]
rangethe geometry range
Returns
true if successful, false otherwise

References debug, woss::CustomDataContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::find(), woss::Singleton< T >::instance(), and setCustomSediment().

Here is the call graph for this function:

◆ setCustomSSP() [1/2]

bool woss::WossDbManager::setCustomSSP ( const SSP ssp,
const Coord tx_coord = CCSSP::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSSP::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSSP::DB_CDATA_ALL_INNER_KEYS,
const Time time_value = CCSSP::DB_CDATA_ALL_TIME_KEYS 
)
inline

Sets the custom SSP for given generator Coord

Parameters
tx_coordconst reference to a valid Coord (generator coordinates)
bearingbearing value [radians]
rangerange value [m]
time_valueconst reference to a valid Time object
Returns
if insertion succeed, the function returns a nullptr pointer, that needs to be initialized. if an object was already instantiated, the function returns the pointer to it;

References ccssp_map, woss::SSP::clone(), and woss::CustomDataTimeContainer< T, MidFunctor, InFunctor, Data, OutComp, MidComp, InComp >::insert().

Referenced by setCustomSSP().

Here is the call graph for this function:

◆ setCustomSSP() [2/2]

bool WossDbManager::setCustomSSP ( const std::string &  sspString,
const Coord txCoord = CCSSP::DB_CDATA_ALL_OUTER_KEYS,
double  bearing = CCSSP::DB_CDATA_ALL_MEDIUM_KEYS,
double  range = CCSSP::DB_CDATA_ALL_INNER_KEYS,
const Time time_value = CCSSP::DB_CDATA_ALL_TIME_KEYS 
)

Converts the input std::string into a custom woss::SSP object and assign it to the designed geometry and simulation time validity.

Parameters
sspStringSSP in string format. syntax:
  • tot_values|depth_1[m]|SSP[m/s]|....|depth_final[m]|SSP_final[m/s]
txCoordthe geometry originating geographical coordinates
bearingthe geometry bearing [radians]
rangethe geometry range
time_valuethe geometry time evolution step
Returns
true if successful, false otherwise

References debug, woss::Singleton< T >::instance(), and setCustomSSP().

Here is the call graph for this function:

◆ setDebug()

WossDbManager & woss::WossDbManager::setDebug ( bool  flag)
inline

References debug, and updateDebugFlag().

Here is the call graph for this function:

◆ setResPressureDb()

WossDbManager & woss::WossDbManager::setResPressureDb ( std::unique_ptr< WossResPressDb ptr)
inline

Initializes the Pressure database pointer WossDbManager takes the ownership of the Db.

Parameters
ptrstd::unique_ptr to a valid WossResPressDb
Returns
reference to *this

References results_pressure_db.

◆ setResTimeArrDb()

WossDbManager & woss::WossDbManager::setResTimeArrDb ( std::unique_ptr< WossResTimeArrDb ptr)
inline

Initializes the TimeArr database pointer WossDbManager takes the ownership of the Db.

Parameters
ptrstd::unique_ptr to a valid WossResTimeArrDb
Returns
reference to *this

References results_arrivals_db.

◆ setSedimentDb()

WossDbManager & woss::WossDbManager::setSedimentDb ( std::unique_ptr< WossSedimentDb ptr)
inline

Initializes the Sediment database pointer. WossDbManager takes the ownership of the Db.

Parameters
ptrstd::unique_ptr to a valid WossSedimentDb
Returns
reference to *this

References sediment_db.

◆ setSSPDb()

WossDbManager & woss::WossDbManager::setSSPDb ( std::unique_ptr< WossSSPDb ptr)
inline

Initializes the SSP database pointer WossDbManager takes the ownership of the Db.

Parameters
ptrstd::unique_ptr to a valid WossSSPDb
Returns
reference to *this

References ssp_db.

◆ updateDebugFlag()

Member Data Documentation

◆ bathymetry_db

std::unique_ptr<WossBathymetryDb> woss::WossDbManager::bathymetry_db
protected

Bathymetry database pointer

Referenced by closeAllConnections(), getBathymetry(), and setBathymetryDb().

◆ ccaltimetry_map

CCAltimetry woss::WossDbManager::ccaltimetry_map
protected

CustomAltimetry containter for user-given generator CoordZ

Referenced by eraseCustomAltimetry(), getAltimetry(), getCustomAltimetry(), setCustomAltimetry(), and updateDebugFlag().

◆ ccbathy_map

CCBathymetry woss::WossDbManager::ccbathy_map
protected

CustomBathymetry containter for user-given generator CoordZ

Referenced by eraseCustomBathymetry(), getBathymetry(), getCustomBathymetry(), importCustomBathymetry(), setCustomBathymetry(), and updateDebugFlag().

◆ ccsediment_map

CCSediment woss::WossDbManager::ccsediment_map
protected

◆ ccssp_map

CCSSP woss::WossDbManager::ccssp_map
protected

CustomSSP containter for user-given generator CoordZ

Referenced by eraseCustomSSP(), getAverageSSP(), getCustomSSP(), getSSP(), importCustomSSP(), setCustomSSP(), and updateDebugFlag().

◆ debug

◆ results_arrivals_db

std::unique_ptr<WossResTimeArrDb> woss::WossDbManager::results_arrivals_db
protected

◆ results_pressure_db

std::unique_ptr<WossResPressDb> woss::WossDbManager::results_pressure_db
protected

◆ sediment_db

std::unique_ptr<WossSedimentDb> woss::WossDbManager::sediment_db
protected

◆ ssp_db

std::unique_ptr<WossSSPDb> woss::WossDbManager::ssp_db
protected

SSP database pointer

Referenced by closeAllConnections(), getAverageSSP(), getSSP(), and setSSPDb().


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