|
World Ocean Simulation System (WOSS) library
|
Textual WossDb for Pressure. More...
#include <res-pressure-txt-db.h>


Public Member Functions | |
| ResPressureTxtDb (const ::std::string &name) | |
| virtual bool | closeConnection () |
| virtual bool | finalizeConnection () |
| virtual Pressure * | getValue (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const |
| virtual bool | insertValue (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const Pressure &pressure) |
Public Member Functions inherited from woss::WossTextualDb | |
| WossTextualDb (const ::std::string &name) | |
| virtual bool | openConnection () |
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 () |
Static Public Member Functions | |
| static void | setSpaceSampling (double value) |
| static double | getSpaceSampling () |
Protected Types | |
| typedef ::std::map< time_t, ::std::complex< double > > | TimeMap |
| typedef TimeMap::iterator | TMIter |
| typedef TimeMap::const_iterator | TMCIter |
| typedef TimeMap::reverse_iterator | TMRIter |
| typedef ::std::map< PDouble, TimeMap > | FreqMap |
| typedef FreqMap::iterator | FMIter |
| typedef FreqMap::reverse_iterator | FMRIter |
| typedef ::std::map< CoordZ, FreqMap, CoordComparator< ResPressureTxtDb, CoordZ > > | RxMap |
| typedef RxMap::iterator | RxMIter |
| typedef RxMap::reverse_iterator | RxMRIter |
| typedef ::std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > > | PressureMatrix |
| typedef PressureMatrix::iterator | PMIter |
| typedef PressureMatrix::const_iterator | PMCIter |
| typedef PressureMatrix::reverse_iterator | PMRIter |
| typedef PressureMatrix::const_reverse_iterator | PMCRIter |
Protected Member Functions | |
| void | printScreenMap () |
| virtual bool | writeMap () |
| virtual bool | importMap () |
| ::std::complex< double > | readMap (const CoordZ &tx, const CoordZ &rx, const double frequency, const Time &time_value) const |
Protected Member Functions inherited from woss::WossDb | |
| PathName | getPathName (const ::std::string &complete_path) |
Protected Attributes | |
| PressureMatrix | pressure_map |
| int | initial_pressmap_size |
| bool | has_been_modified |
Protected Attributes inherited from woss::WossTextualDb | |
| ::std::fstream | textual_db |
Protected Attributes inherited from woss::WossDb | |
| ::std::string | db_name |
| bool | debug |
Static Protected Attributes | |
| static double | space_sampling = 0.0 |
ResPressureTxtDb implements WossTextualDb and WossResPressDb for storing calculated Pressure into a text file
|
protected |
| ResPressureTxtDb::ResPressureTxtDb | ( | const ::std::string & | name | ) |
ResPressureTxtDb constructor
| name | pathname of database |
|
virtual |
Closes the connection to the text file provided
Reimplemented from woss::WossTextualDb.
References woss::WossTextualDb::closeConnection(), and writeMap().

|
virtual |
Post openConnection() actions
Implements woss::WossDb.
References importMap().

|
virtual |
Returns a pointer to a heap-created Pressure for 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 |
Implements woss::WossResPressDb.
References woss::Pressure::createNotValid(), woss::Singleton< T >::instance(), woss::Time::isValid(), pressure_map, and readMap().

|
protectedvirtual |
Imports the formatted textual files into pressure_map. The column format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, real pressure, imag pressure
Reimplemented in woss::ResPressureBinDb.
References woss::WossDb::db_name, woss::WossDb::debug, initial_pressmap_size, pressure_map, printScreenMap(), and woss::WossTextualDb::textual_db.
Referenced by finalizeConnection().

|
virtual |
Inserts the given Pressure value in the pressure_map 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 |
| pressure | computed Pressure |
Implements woss::WossResPressDb.
References woss::WossDb::debug, and pressure_map.
|
protected |
Prints pressure_map to screen. The columns format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, real pressure, imag pressure
References pressure_map, and woss::WossTextualDb::textual_db.
Referenced by woss::ResPressureBinDb::importMap(), and importMap().
|
protected |
Reads given values from pressure_map
| tx | valid transmitter coordinates |
| rx | valid receiver coordinates |
| frequency | frequency [hz] |
| time_value | const reference to a valid time_value |
References woss::Pressure::createNotValid(), and pressure_map.
Referenced by getValue().

|
protectedvirtual |
Writes pressure_map to textual files. The columns format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, real pressure, imag pressure
Reimplemented in woss::ResPressureBinDb.
References woss::WossDb::db_name, pressure_map, and woss::WossTextualDb::textual_db.
Referenced by closeConnection().
|
protected |
pressure_map's initial size. If pressure_map's size is greater on closeConnection() the map will be written to disk
Referenced by woss::ResPressureBinDb::importMap(), and importMap().
|
protected |
PressureMatrix map for storing imported and user inserted Pressure values
Referenced by getValue(), woss::ResPressureBinDb::importMap(), importMap(), insertValue(), printScreenMap(), readMap(), woss::ResPressureBinDb::writeMap(), and writeMap().