World Ocean Simulation System (WOSS) library
res-pressure-txt-db.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
29
40#ifndef WOSS_RES_PRESSURE_TXT_DB_H
41#define WOSS_RES_PRESSURE_TXT_DB_H
42
43
44#include <map>
45#include <complex>
47#include "woss-db.h"
48
49
50namespace woss {
51
52
60
61
62 public:
63
64
69 ResPressureTxtDb( const ::std::string& name );
70
71 virtual ~ResPressureTxtDb() { }
72
73
78 virtual bool closeConnection();
79
80
85 virtual bool finalizeConnection();
86
87
98 virtual Pressure* getValue( const CoordZ& coord_tx, const CoordZ& coord_rx, const double frequency, const Time& time_value ) const;
99
100
109 virtual bool insertValue( const CoordZ& coord_tx, const CoordZ& coord_rx, const double frequency, const Time& time_value, const Pressure& pressure );
110
111
112 static void setSpaceSampling( double value ) { space_sampling = value; }
113
114 static double getSpaceSampling() { return space_sampling; }
115
116
117 protected:
118
119
120 typedef ::std::map< time_t, ::std::complex< double > > TimeMap;
121 typedef TimeMap::iterator TMIter;
122 typedef TimeMap::const_iterator TMCIter;
123 typedef TimeMap::reverse_iterator TMRIter;
124
125 typedef ::std::map< PDouble, TimeMap > FreqMap;
126 typedef FreqMap::iterator FMIter;
127 typedef FreqMap::reverse_iterator FMRIter;
128
129 typedef ::std::map< CoordZ, FreqMap, CoordComparator< ResPressureTxtDb, CoordZ > > RxMap;
130 typedef RxMap::iterator RxMIter;
131 typedef RxMap::reverse_iterator RxMRIter;
132
137 typedef ::std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > > PressureMatrix;
138 typedef PressureMatrix::iterator PMIter;
139 typedef PressureMatrix::const_iterator PMCIter;
140 typedef PressureMatrix::reverse_iterator PMRIter;
141 typedef PressureMatrix::const_reverse_iterator PMCRIter;
142
143
144 static double space_sampling;
145
146
151
156
157 bool has_been_modified;
158
159
165 void printScreenMap();
166
172 virtual bool writeMap();
173
179 virtual bool importMap();
180
181
190 ::std::complex<double> readMap( const CoordZ& tx, const CoordZ& rx, const double frequency, const Time& time_value ) const;
191
192
193 };
194
195
196}
197#endif /* WOSS_RES_PRESSURE_TXT_DB_H */
198
199
200
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
Complex attenuated pressure class.
Definition pressure-definitions.h:59
Textual WossDb for Pressure.
Definition res-pressure-txt-db.h:59
virtual bool insertValue(const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const Pressure &pressure)
Definition res-pressure-txt-db.cpp:338
int initial_pressmap_size
Definition res-pressure-txt-db.h:155
::std::complex< double > readMap(const CoordZ &tx, const CoordZ &rx, const double frequency, const Time &time_value) const
Definition res-pressure-txt-db.cpp:125
void printScreenMap()
Definition res-pressure-txt-db.cpp:238
virtual bool closeConnection()
Definition res-pressure-txt-db.cpp:322
virtual Pressure * getValue(const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const
Definition res-pressure-txt-db.cpp:330
::std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > > PressureMatrix
Definition res-pressure-txt-db.h:137
virtual bool finalizeConnection()
Definition res-pressure-txt-db.cpp:316
virtual bool writeMap()
Definition res-pressure-txt-db.cpp:154
virtual bool importMap()
Definition res-pressure-txt-db.cpp:70
PressureMatrix pressure_map
Definition res-pressure-txt-db.h:150
a class for time date manipulation
Definition time-definitions.h:95
Data behaviour class for storing calculated Pressure.
Definition woss-db.h:458
Textual implementation of WossDb.
Definition woss-db.h:245
Provides the interface for the woss::PDouble class.
Provides the interface for woss::WossDb class.