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

Binary WossDb for Pressure. More...

#include <res-pressure-bin-db.h>

Inheritance diagram for woss::ResPressureBinDb:
Inheritance graph
Collaboration diagram for woss::ResPressureBinDb:
Collaboration graph

Public Member Functions

 ResPressureBinDb (const std::string &name)
 
virtual ~ResPressureBinDb () override=default
 
- Public Member Functions inherited from woss::ResPressureTxtDb
 ResPressureTxtDb (const std::string &name)
 
virtual ~ResPressureTxtDb () override=default
 
virtual bool closeConnection () override
 
virtual bool finalizeConnection () override
 
virtual std::unique_ptr< PressuregetValue (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const override
 
virtual bool insertValue (const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const Pressure &pressure) override
 
- Public Member Functions inherited from woss::WossTextualDb
 WossTextualDb (const std::string &name)
 
virtual ~WossTextualDb () override
 
virtual bool openConnection () override
 
- Public Member Functions inherited from woss::WossDb
 WossDb (const std::string &name)
 
virtual ~WossDb ()=default
 
void setDbName (const std::string &pathname)
 
std::string getDbName () const
 
void setDebug (double flag=true)
 
bool isUsingDebug () const
 
virtual bool isValid () const
 
- Public Member Functions inherited from woss::WossResPressDb
 WossResPressDb ()=default
 
virtual ~WossResPressDb ()=default
 

Protected Member Functions

virtual bool writeMap () override
 
virtual bool importMap () override
 
- Protected Member Functions inherited from woss::ResPressureTxtDb
void printScreenMap ()
 
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) const
 

Additional Inherited Members

- Static Public Member Functions inherited from woss::ResPressureTxtDb
static void setSpaceSampling (double value)
 
static double getSpaceSampling ()
 
- Protected Types inherited from woss::ResPressureTxtDb
using TimeMap = std::map< time_t, std::complex< double > >
 
using TMIter = TimeMap::iterator
 
using TMCIter = TimeMap::const_iterator
 
using TMRIter = TimeMap::reverse_iterator
 
using FreqMap = std::map< PDouble, TimeMap >
 
using FMIter = FreqMap::iterator
 
using FMCIter = FreqMap::const_iterator
 
using FMRIter = FreqMap::reverse_iterator
 
using RxMap = std::map< CoordZ, FreqMap, CoordComparator< ResPressureTxtDb, CoordZ > >
 
using RxMIter = RxMap::iterator
 
using RxCIter = RxMap::const_iterator
 
using RxMRIter = RxMap::reverse_iterator
 
using PressureMatrix = std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > >
 
using PMIter = PressureMatrix::iterator
 
using PMCIter = PressureMatrix::const_iterator
 
using PMRIter = PressureMatrix::reverse_iterator
 
using PMCRIter = PressureMatrix::const_reverse_iterator
 
- Protected Attributes inherited from woss::ResPressureTxtDb
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 inherited from woss::ResPressureTxtDb
static double space_sampling = 0.0
 

Detailed Description

Binary WossDb for Pressure.

ResPressureBinDb implements WossTextualDb and WossResPressDb for storing calculated Pressure into a binary file

Constructor & Destructor Documentation

◆ ResPressureBinDb()

woss::ResPressureBinDb::ResPressureBinDb ( const std::string &  name)
inline

ResPressureBinDb constructor

Parameters
namepathname of database

◆ ~ResPressureBinDb()

virtual woss::ResPressureBinDb::~ResPressureBinDb ( )
overridevirtualdefault

Member Function Documentation

◆ importMap()

bool ResPressureBinDb::importMap ( )
overrideprotectedvirtual

Imports the formatted binary file into pressure_map. The format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, real pressure, imag pressure

Returns
true if operation succeeds, false otherwise

Reimplemented from woss::ResPressureTxtDb.

References woss::WossDb::db_name, woss::WossDb::debug, woss::ResPressureTxtDb::initial_pressmap_size, woss::ResPressureTxtDb::pressure_map, woss::ResPressureTxtDb::printScreenMap(), and woss::WossTextualDb::textual_db.

Here is the call graph for this function:

◆ writeMap()

bool ResPressureBinDb::writeMap ( )
overrideprotectedvirtual

Writes pressure_map to binary file. The format is the following:
tx latitude, tx longitude, tx depth, rx latitude, rx longitude, rx depth, frequency, real pressure, imag pressure

Returns
true if operation succeeds, false otherwise

Reimplemented from woss::ResPressureTxtDb.

References woss::WossDb::db_name, woss::WossDb::debug, woss::ResPressureTxtDb::pressure_map, woss::ResPressureTxtDb::printScreenMap(), and woss::WossTextualDb::textual_db.

Here is the call graph for this function:

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