|
World Ocean Simulation System (WOSS) library
|
Abstraction layer for database and data manipulation. More...
#include <woss-db-manager.h>

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> > |
Protected Member Functions | |
| virtual bool | closeAllConnections () |
| virtual void | updateDebugFlag () |
Protected Attributes | |
| std::unique_ptr< WossBathymetryDb > | bathymetry_db |
| std::unique_ptr< WossSedimentDb > | sediment_db |
| std::unique_ptr< WossSSPDb > | ssp_db |
| std::unique_ptr< WossResTimeArrDb > | results_arrivals_db |
| std::unique_ptr< WossResPressDb > | results_pressure_db |
| bool | debug |
| CCBathymetry | ccbathy_map |
| CCSediment | ccsediment_map |
| CCSSP | ccssp_map |
| CCAltimetry | ccaltimetry_map |
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.
| using woss::WossDbManager::CCAltimetry = CustomDataContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr<Altimetry> > |
| using woss::WossDbManager::CCBathymetry = CustomDataContainer< Coord, BearingOperator, RangeOperator, Bathymetry > |
| using woss::WossDbManager::CCSediment = CustomDataContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr<Sediment> > |
| using woss::WossDbManager::CCSSP = CustomDataTimeContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr<SSP> > |
| WossDbManager::WossDbManager | ( | ) |
Default constructor
References bathymetry_db, ccaltimetry_map, ccbathy_map, ccsediment_map, ccssp_map, debug, results_arrivals_db, results_pressure_db, sediment_db, ssp_db, and updateDebugFlag().
Referenced by eraseCustomAltimetry(), eraseCustomBathymetry(), eraseCustomSediment(), eraseCustomSSP(), operator=(), operator=(), setBathymetryDb(), setDebug(), setResPressureDb(), setResTimeArrDb(), setSedimentDb(), setSSPDb(), WossDbManager(), and WossDbManager().

|
default |
|
default |
|
virtualdefault |
Destructor. It deletes all pointers involved. Derived classes don't have to do it
|
protectedvirtual |
Closes all connections of owned databases
References bathymetry_db, woss::WossDb::closeConnection(), results_arrivals_db, results_pressure_db, sediment_db, and ssp_db.

|
inline |
Erases the custom Altimetry for given parameters
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccaltimetry_map, and WossDbManager().
Referenced by WossUnitTest::testWossDbManager().

|
inline |
Erases the custom Bathymetry for given parameters
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccbathy_map, and WossDbManager().

|
inline |
Erases the custom Sediment for given parameters
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccsediment_map, and WossDbManager().

|
inline |
Erases the custom SSP for given parameters
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
| time_value | const reference to a valid Time object |
References ccssp_map, and WossDbManager().

|
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
| coords | const reference to a valid CoordZ object |
References ccaltimetry_map, woss::DefHandler::createAltimetry(), woss::Altimetry::createNotValid(), debug, and woss::Singleton< DefHandler >::instance().

|
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
| coords | const reference to a valid Coord object |
| time_start | const reference to a valid Time object |
| time_end | const reference to a valid Time object |
| max_time_values | total number of Time to take between time_start and time_end |
| ssp_depth_precision | returned SSP's depth precision |
References ccssp_map, woss::DefHandler::createSSP(), woss::Singleton< DefHandler >::instance(), and ssp_db.

|
virtual |
Returns the positive depth value ( bathymetry ) of given coordinates, if present in the database
| coords | const reference to a valid Coord object |
References bathymetry_db, ccbathy_map, and debug.
Referenced by getBathymetry().
|
virtual |
Sets the positive depth for each CoordZ present in the vector, HUGE_VAL is set if coordinates are not present in the database
| coords | reference to a CoordZVector |
References getBathymetry().

|
inline |
Gets the custom Altimetry for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccaltimetry_map, woss::Altimetry::createNotValid(), and woss::Singleton< DefHandler >::instance().
Referenced by WossUnitTest::testWossDbManager().

|
inline |
Gets the custom Bathymetry for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccbathy_map.
Referenced by WossUnitTest::testWossDbManager().
|
inline |
Gets the custom Sediment for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccsediment_map, and woss::Singleton< DefHandler >::instance().
Referenced by WossUnitTest::testWossDbManager().

|
inline |
Gets the custom SSP for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
| time_value | const reference to a valid Time object |
References ccssp_map, and woss::Singleton< DefHandler >::instance().
Referenced by WossUnitTest::testWossDbManager().

|
inline |
References debug.
|
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
| coord_tx | const reference to a valid CoordZ object |
| coord_rx | const reference to a valid CoordZ object |
| frequency | used frequency [hz] |
| time_value | const reference to a valid Time object |
References woss::Pressure::createNotValid(), woss::Singleton< DefHandler >::instance(), and results_pressure_db.

|
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
| coords | const reference to a valid CoordZ object |
References ccsediment_map, woss::DefHandler::createSediment(), debug, woss::Singleton< DefHandler >::instance(), and sediment_db.
Referenced by getSediment().

|
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
| coordz_vector | const reference to a valid CoordZ vector |
References ccsediment_map, woss::DefHandler::createSediment(), debug, getSediment(), woss::Singleton< DefHandler >::instance(), and sediment_db.

|
virtual |
Returns the SSP value of given coordinates and date time if both present in the database. User is responsible of pointer's ownership
| coords | const reference to a valid Coord object |
| time | const reference to a valid Time object |
| ssp_depth_precision | ssp depth precision [m] |
References ccssp_map, woss::DefHandler::createSSP(), woss::Singleton< DefHandler >::instance(), and ssp_db.

|
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
| coord_tx | const reference to a valid CoordZ object |
| coord_rx | const reference to a valid CoordZ object |
| frequency | used frequency [hz] |
| time_value | const reference to a valid Time object |
References woss::TimeArr::createNotValid(), woss::Singleton< DefHandler >::instance(), and results_arrivals_db.

|
virtual |
Imports a CustomBathymetry from file. The file has to be a two column format: Range [m] Depth [m]
| filename | const reference to a string |
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
References ccbathy_map, and debug.
|
virtual |
Imports a CustomSSP from file.
File format:
Following format depends on type name:
| filename | const reference to a string |
| time | const reference to a valid Time object |
| tx_coord | const reference to a valid Coord object (originator coordinates) |
| bearing | bearing value [radians] |
References ccssp_map, woss::CustomDataTimeContainer< Coord, BearingOperator, RangeOperator, std::shared_ptr< SSP > >::DB_CDATA_ALL_INNER_KEYS, debug, and woss::Singleton< DefHandler >::instance().

|
virtual |
Inserts the given Pressure value in the database at given frequency, transmitter and receiver coordinates
| coord_tx | const reference to a valid CoordZ object |
| coord_rx | const reference to a valid CoordZ object |
| frequency | used frequency [hz] |
| time_value | const reference to a valid Time object |
| channel | computed Pressure |
References results_pressure_db.
|
virtual |
Inserts a given TimeArr value in the database at given frequency, transmitter and receiver coordinates
| coord_tx | const reference to a valid CoordZ object |
| coord_rx | const reference to a valid CoordZ object |
| frequency | used frequency [hz] |
| time_value | const reference to a valid Time object |
| channel | computed TimeArr |
References results_arrivals_db.
|
default |
|
default |
|
inline |
Initializes the bathymetry database pointer. WossDbManager takes the ownership of the Db.
| ptr | valid std::unique_ptr WossBathymetryDb |
References bathymetry_db, and WossDbManager().

|
inline |
Sets the custom Altimetry for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccaltimetry_map, and woss::Altimetry::clone().
Referenced by WossUnitTest::testWossDbManager().

|
inline |
Sets the custom Bathymetry for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccbathy_map.
Referenced by setCustomBathymetry(), and WossUnitTest::testWossDbManager().
| 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
| bathyLine | bathymetry in string format. syntax:
|
| txCoord | the geometry originating geographical coordinates |
| bearing | the geometry bearing [radians] |
References debug, and setCustomBathymetry().

|
inline |
Sets the custom Sediment for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
References ccsediment_map, and woss::Sediment::clone().
Referenced by setCustomSediment(), and WossUnitTest::testWossDbManager().

| 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.
| sediment_string | SSP in string format. syntax:
|
| txCoord | the geometry originating geographical coordinates |
| bearing | the geometry bearing [radians] |
| range | the geometry range |
References woss::DefHandler::createSediment(), debug, woss::Singleton< DefHandler >::instance(), and setCustomSediment().

|
inline |
Sets the custom SSP for given generator Coord
| tx_coord | const reference to a valid Coord (generator coordinates) |
| bearing | bearing value [radians] |
| range | range value [m] |
| time_value | const reference to a valid Time object |
References ccssp_map, and woss::SSP::clone().
Referenced by setCustomSSP(), and WossUnitTest::testWossDbManager().

| 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.
| sspString | SSP in string format. syntax:
|
| txCoord | the geometry originating geographical coordinates |
| bearing | the geometry bearing [radians] |
| range | the geometry range |
| time_value | the geometry time evolution step |
References woss::DefHandler::createSSP(), debug, woss::Singleton< DefHandler >::instance(), and setCustomSSP().

|
inline |
|
inline |
Initializes the Pressure database pointer WossDbManager takes the ownership of the Db.
| ptr | std::unique_ptr to a valid WossResPressDb |
References results_pressure_db, and WossDbManager().

|
inline |
Initializes the TimeArr database pointer WossDbManager takes the ownership of the Db.
| ptr | std::unique_ptr to a valid WossResTimeArrDb |
References results_arrivals_db, and WossDbManager().

|
inline |
Initializes the Sediment database pointer. WossDbManager takes the ownership of the Db.
| ptr | std::unique_ptr to a valid WossSedimentDb |
References sediment_db, and WossDbManager().

|
inline |
Initializes the SSP database pointer WossDbManager takes the ownership of the Db.
| ptr | std::unique_ptr to a valid WossSSPDb |
References ssp_db, and WossDbManager().

|
protectedvirtual |
References ccaltimetry_map, ccbathy_map, ccsediment_map, ccssp_map, and debug.
Referenced by setDebug(), and WossDbManager().
|
protected |
Bathymetry database pointer
Referenced by closeAllConnections(), getBathymetry(), setBathymetryDb(), and WossDbManager().
|
protected |
CustomAltimetry containter for user-given generator CoordZ
Referenced by eraseCustomAltimetry(), getAltimetry(), getCustomAltimetry(), setCustomAltimetry(), updateDebugFlag(), and WossDbManager().
|
protected |
CustomBathymetry containter for user-given generator CoordZ
Referenced by eraseCustomBathymetry(), getBathymetry(), getCustomBathymetry(), importCustomBathymetry(), setCustomBathymetry(), updateDebugFlag(), and WossDbManager().
|
protected |
custom Sediment containter for user-given generator CoordZ
Referenced by eraseCustomSediment(), getCustomSediment(), getSediment(), getSediment(), setCustomSediment(), updateDebugFlag(), and WossDbManager().
|
protected |
CustomSSP containter for user-given generator CoordZ
Referenced by eraseCustomSSP(), getAverageSSP(), getCustomSSP(), getSSP(), importCustomSSP(), setCustomSSP(), updateDebugFlag(), and WossDbManager().
|
protected |
Debug flag
Referenced by getAltimetry(), getBathymetry(), getDebug(), getSediment(), getSediment(), importCustomBathymetry(), importCustomSSP(), setCustomBathymetry(), setCustomSediment(), setCustomSSP(), setDebug(), updateDebugFlag(), and WossDbManager().
|
protected |
TimeArr database pointer
Referenced by closeAllConnections(), getTimeArr(), insertTimeArr(), setResTimeArrDb(), and WossDbManager().
|
protected |
Pressure database pointer
Referenced by closeAllConnections(), getPressure(), insertPressure(), setResPressureDb(), and WossDbManager().
|
protected |
Sediment database pointer
Referenced by closeAllConnections(), getSediment(), getSediment(), setSedimentDb(), and WossDbManager().
|
protected |
SSP database pointer
Referenced by closeAllConnections(), getAverageSSP(), getSSP(), setSSPDb(), and WossDbManager().