General Purpose Geodetic Library
SgNetworkStnRecord.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2016-2020 Sergei Bolotin.
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 as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SG_NETWORK_STN_RECORD_H
24 #define SG_NETWORK_STN_RECORD_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <math.h>
33 
34 #include <QtCore/QString>
35 #include <QtCore/QList>
36 #include <QtCore/QMap>
37 #include <QtCore/QMultiMap>
38 
39 
40 
41 /***===================================================================================================*/
48 {
49 public:
50  // Statics:
53  static const QString className();
54 
55  //
56  // constructors/destructors:
57  //
61  inline SgNetworkStnRecord();
62 
64 
68  inline ~SgNetworkStnRecord();
69 
70 
71 
72  //
73  // Interfaces:
74  //
78 
79  inline bool isValid() const;
80 
81  inline const QString& getName() const;
82 
83  inline const QString& getCode() const;
84 
85  inline const QString& getDomesId() const;
86 
87  inline const QString& getCdpId() const;
88 
89  inline const QString& getDescription() const;
90 
91 
92  inline void setName(const QString& s);
93 
94  inline void setCode(const QString& s);
95 
96  inline void setDomesId(const QString& s);
97 
98  inline void setCdpId(const QString& s);
99 
100  inline void setDescription(const QString& s);
101 
102 
103  //
104  // Functions:
105  //
106  bool parseString(const QString&);
107 
108  //
109  // Friends:
110  //
111 
112  //
113  // I/O:
114  //
115  // ...
116 
117 private:
118  bool isValid_;
119  // a masterfile record:
120  QString name_;
121  QString code_;
122  QString domesId_;
123  QString cdpId_;
124  QString description_;
125 };
126 /*=====================================================================================================*/
127 
128 
129 
130 
131 
132 
133 /***===================================================================================================*/
140 {
141 public:
142  // Statics:
145  static const QString className();
146 
147  //
148  // constructors/destructors:
149  //
153  inline SgNetworkStations(const QString& path2file);
154 
158  inline ~SgNetworkStations();
159 
160  //
161  // Interfaces:
162  //
163  inline bool isOk() const {return isOk_;};
164  inline const QString& getFileName() const {return fileName_;};
165  inline const QString& getPath2file() const {return path2file_;};
166 
167  inline void setFileName(const QString& fn) {fileName_ = fn;};
168  inline void setPath2file(const QString& path) {path2file_ = path;};
171 
172  //
173  // Functions:
174  //
175  bool readFile();
176  const SgNetworkStnRecord& lookUp(const QString&);
177 
178 
179  //
180  // Friends:
181  //
182 
183  //
184  // I/O:
185  //
186  // ...
187 
188 private:
189  bool isOk_;
190  QString path2file_;
191  QString fileName_;
196 };
197 /*=====================================================================================================*/
198 
199 
200 
201 
202 
203 
204 
205 /*=====================================================================================================*/
206 /* */
207 /* SgNetworkStnRecord inline members: */
208 /* */
209 /*=====================================================================================================*/
210 //
211 //
212 // CONSTRUCTORS:
213 //
214 // An empty constructor:
216  name_(""),
217  code_(""),
218  domesId_(""),
219  cdpId_(""),
220  description_("")
221 {
222  isValid_ = false;
223 };
224 
225 
226 
227 // A destructor:
229 {
230 };
231 
232 
233 
234 //
235 // INTERFACES:
236 //
237 //
238 // Gets:
239 //
240 inline bool SgNetworkStnRecord::isValid() const
241 {
242  return isValid_;
243 };
244 
245 
246 
247 //
248 inline const QString& SgNetworkStnRecord::getName() const
249 {
250  return name_;
251 };
252 
253 
254 
255 //
256 inline const QString& SgNetworkStnRecord::getCode() const
257 {
258  return code_;
259 };
260 
261 
262 
263 //
264 inline const QString& SgNetworkStnRecord::getDomesId() const
265 {
266  return domesId_;
267 };
268 
269 
270 
271 //
272 inline const QString& SgNetworkStnRecord::getCdpId() const
273 {
274  return cdpId_;
275 };
276 
277 
278 
279 //
280 inline const QString& SgNetworkStnRecord::getDescription() const
281 {
282  return description_;
283 };
284 
285 
286 // Sets:
287 //
288 inline void SgNetworkStnRecord::setName(const QString& s)
289 {
290  name_ = s;
291 };
292 
293 
294 
295 //
296 inline void SgNetworkStnRecord::setCode(const QString& s)
297 {
298  code_ = s;
299 };
300 
301 
302 
303 //
304 inline void SgNetworkStnRecord::setDomesId(const QString& s)
305 {
306  domesId_ = s;
307 };
308 
309 
310 
311 //
312 inline void SgNetworkStnRecord::setCdpId(const QString& s)
313 {
314  cdpId_ = s;
315 };
316 
317 
318 
319 //
320 inline void SgNetworkStnRecord::setDescription(const QString& s)
321 {
322  description_ = s;
323 };
324 
325 
326 
327 //
328 // FUNCTIONS:
329 //
330 //
331 //
332 
333 //
334 // FRIENDS:
335 //
336 //
337 //
338 /*=====================================================================================================*/
339 
340 
341 
342 
343 
344 /*=====================================================================================================*/
345 /* */
346 /* SgNetworkStations's inline members: */
347 /* */
348 /*=====================================================================================================*/
349 //
350 //
351 // CONSTRUCTORS:
352 //
353 // An empty constructor:
354 inline SgNetworkStations::SgNetworkStations(const QString& path2file) :
355  path2file_(path2file),
356  fileName_("ns-codes.txt"),
357  recByName_(),
358  recById_()
359 {
360  isOk_ = false;
361 };
362 
363 
364 
365 // A destructor:
367 {
368  recByName_.clear();
369  recById_.clear();
370 };
371 
372 
373 
374 //
375 // INTERFACES:
376 //
377 //
378 
379 //
380 // FUNCTIONS:
381 //
382 //
383 //
384 
385 //
386 // FRIENDS:
387 //
388 //
389 //
390 /*=====================================================================================================*/
391 
392 
393 
394 /*=====================================================================================================*/
395 //
396 // aux functions:
397 //
398 
399 
400 /*=====================================================================================================*/
401 #endif //SG_NETWORK_STN_RECORD_H
const QMultiMap< QString, SgNetworkStnRecord > & recsById() const
const SgNetworkStnRecord & lookUp(const QString &)
void setPath2file(const QString &path)
void setFileName(const QString &fn)
SgNetworkStations(const QString &path2file)
static const QString className()
const QMultiMap< QString, SgNetworkStnRecord > & recsByName() const
QMultiMap< QString, SgNetworkStnRecord > recById_
QMultiMap< QString, SgNetworkStnRecord > recByName_
const QString & getPath2file() const
const QString & getFileName() const
bool parseString(const QString &)
const QString & getDescription() const
const QString & getCdpId() const
void setName(const QString &s)
void setCdpId(const QString &s)
void setDescription(const QString &s)
const QString & getName() const
SgNetworkStnRecord & operator=(const SgNetworkStnRecord &r)
void setCode(const QString &s)
static const QString className()
void setDomesId(const QString &s)
const QString & getDomesId() const
const QString & getCode() const