World Ocean Simulation System (WOSS) library
|
Textual WossDb for TimeArr. More...
#include <res-time-arr-txt-db.h>
Public Member Functions | |
ResTimeArrTxtDb (const ::std::string &name) | |
virtual bool | finalizeConnection () |
virtual bool | closeConnection () |
virtual TimeArr * | 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 TimeArr &channel) |
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, TimeArr > | 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::const_iterator | FMCIter |
typedef FreqMap::reverse_iterator | FMRIter |
typedef ::std::map< CoordZ, FreqMap, CoordComparator< ResTimeArrTxtDb, CoordZ > > | RxMap |
typedef RxMap::iterator | RxMIter |
typedef RxMap::const_iterator | RxMCIter |
typedef RxMap::reverse_iterator | RxMRIter |
typedef ::std::map< CoordZ, RxMap, CoordComparator< ResTimeArrTxtDb, CoordZ > > | ArrMatrix |
typedef ArrMatrix::iterator | AMXIter |
typedef ArrMatrix::const_iterator | AMXCIter |
typedef ArrMatrix::reverse_iterator | AMXRIter |
typedef ArrMatrix::const_reverse_iterator | AMXCRIter |
Protected Member Functions | |
void | printScreenMap () |
virtual bool | writeMap () |
virtual bool | importMap () |
const TimeArr * | 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 | |
ArrMatrix | arrivals_map |
int | initial_arrmap_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 |
ResTimeArrTxtDb implements WossTextualDb and WossResTimeArrDb for storing calculated TimeArr into a text file
|
protected |
ResTimeArrTxtDb::ResTimeArrTxtDb | ( | const ::std::string & | name | ) |
ResTimeArrTxtDb 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 TimeArr value 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::WossResTimeArrDb.
References arrivals_map, woss::TimeArr::create(), woss::TimeArr::createNotValid(), woss::Singleton< T >::instance(), woss::Time::isValid(), and readMap().
|
protectedvirtual |
Imports the formatted textual files into arrivals_map. The column format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, total channel taps, delay-i-th real pressure-i-th, imag pressure-i-th
Reimplemented in woss::ResTimeArrBinDb.
References arrivals_map, woss::WossDb::db_name, woss::WossDb::debug, initial_arrmap_size, woss::TimeArr::insertValue(), printScreenMap(), and woss::WossTextualDb::textual_db.
Referenced by finalizeConnection().
|
virtual |
Inserts the given TimeArr value in the arrivals_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 |
channel | computed TimeArr |
Implements woss::WossResTimeArrDb.
References arrivals_map, and woss::WossDb::debug.
|
protected |
Prints arrivals_map to screen. The columns format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, total channel taps, delay-i-th real pressure-i-th, imag pressure-i-th
References arrivals_map, woss::TimeArr::begin(), woss::TimeArr::end(), woss::TimeArr::size(), and woss::WossTextualDb::textual_db.
Referenced by woss::ResTimeArrBinDb::importMap(), and importMap().
|
protected |
Reads given values from arrivals_map
tx | valid transmitter coordinates |
rx | valid receiver coordinates |
frequency | frequency [hz] |
time_value | const reference to a valid Time object |
References arrivals_map, and woss::WossDb::debug.
Referenced by getValue().
|
protectedvirtual |
Writes arrivals_map into the textual file. The columns format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, total channel taps, delay-i-th real pressure-i-th, imag pressure-i-th
Reimplemented in woss::ResTimeArrBinDb.
References arrivals_map, woss::TimeArr::begin(), woss::WossDb::db_name, woss::TimeArr::end(), woss::TimeArr::size(), and woss::WossTextualDb::textual_db.
Referenced by closeConnection().
|
protected |
ArrMatrix map for storing imported and user inserted TimeArr values
Referenced by getValue(), woss::ResTimeArrBinDb::importMap(), importMap(), insertValue(), printScreenMap(), readMap(), woss::ResTimeArrBinDb::writeMap(), and writeMap().
|
protected |
arrivals_map's initial size. If pressure_map's size is greater on closeConnection() the map will be written to disk
Referenced by woss::ResTimeArrBinDb::importMap(), and importMap().