source: ntrip/trunk/BNC/src/PPP/pppObsPool.cpp@ 5817

Last change on this file since 5817 was 5814, checked in by mervart, 10 years ago
File size: 3.0 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
29 * Class: t_pppMain
30 *
31 * Purpose: Buffer with observations
32 *
33 * Author: L. Mervart
34 *
35 * Created: 29-Jul-2014
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include "pppObsPool.h"
42
43using namespace BNC_PPP;
44using namespace std;
45
46// Constructor
47/////////////////////////////////////////////////////////////////////////////
48t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
49 _epoTime = epoTime;
50 for (unsigned ii = 0; ii < obsVector.size(); ii++) {
51 _obsVector.push_back(obsVector[ii]);
52 }
53 obsVector.clear();
54}
55
56// Destructor
57/////////////////////////////////////////////////////////////////////////////
58t_pppObsPool::t_epoch::~t_epoch() {
59 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
60 delete _obsVector[ii];
61 }
62}
63
64// Constructor
65/////////////////////////////////////////////////////////////////////////////
66t_pppObsPool::t_pppObsPool() {
67 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
68 _satBiases[ii] = 0;
69 }
70}
71
72// Destructor
73/////////////////////////////////////////////////////////////////////////////
74t_pppObsPool::~t_pppObsPool() {
75 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
76 delete _satBiases[ii];
77 }
78 while (_epochs.size() > 0) {
79 delete _epochs.front();
80 _epochs.pop_front();
81 }
82}
83
84//
85/////////////////////////////////////////////////////////////////////////////
86void t_pppObsPool::putBiases(t_satBias* satBias) {
87 int iPrn = satBias->prn().toInt();
88 delete _satBiases[iPrn];
89 _satBiases[iPrn] = satBias;
90}
91
92//
93/////////////////////////////////////////////////////////////////////////////
94void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
95 const unsigned MAXSIZE = 2;
96 _epochs.push_back(new t_epoch(epoTime, obsVector));
97 if (_epochs.size() > MAXSIZE) {
98 delete _epochs.front();
99 _epochs.pop_front();
100 }
101}
Note: See TracBrowser for help on using the repository browser.