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

Last change on this file since 8443 was 7643, checked in by stuerze, 9 years ago

some code cleanup

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 2.7 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: t_pppObsPool
6 *
7 * Purpose: Buffer with observations
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Jul-2014
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include "pppObsPool.h"
18
19using namespace BNC_PPP;
20using namespace std;
21
22// Constructor
23/////////////////////////////////////////////////////////////////////////////
24t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
25 _epoTime = epoTime;
26 for (unsigned ii = 0; ii < obsVector.size(); ii++) {
27 _obsVector.push_back(obsVector[ii]);
28 }
29 obsVector.clear();
30}
31
32// Destructor
33/////////////////////////////////////////////////////////////////////////////
34t_pppObsPool::t_epoch::~t_epoch() {
35 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
36 delete _obsVector[ii];
37 }
38}
39
40// Constructor
41/////////////////////////////////////////////////////////////////////////////
42t_pppObsPool::t_pppObsPool() {
43 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
44 _satCodeBiases[ii] = 0;
45 }
46 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
47 _satPhaseBiases[ii] = 0;
48 }
49 _vTec = 0;
50}
51
52// Destructor
53/////////////////////////////////////////////////////////////////////////////
54t_pppObsPool::~t_pppObsPool() {
55 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
56 delete _satCodeBiases[ii];
57 }
58 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
59 delete _satPhaseBiases[ii];
60 }
61 delete _vTec;
62 while (_epochs.size() > 0) {
63 delete _epochs.front();
64 _epochs.pop_front();
65 }
66}
67
68//
69/////////////////////////////////////////////////////////////////////////////
70void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
71 int iPrn = satCodeBias->_prn.toInt();
72 delete _satCodeBiases[iPrn];
73 _satCodeBiases[iPrn] = satCodeBias;
74}
75
76//
77/////////////////////////////////////////////////////////////////////////////
78void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
79 int iPrn = satPhaseBias->_prn.toInt();
80 delete _satPhaseBiases[iPrn];
81 _satPhaseBiases[iPrn] = satPhaseBias;
82}
83
84//
85/////////////////////////////////////////////////////////////////////////////
86void t_pppObsPool::putTec(t_vTec* vTec) {
87 delete _vTec;
88 _vTec = new t_vTec(*vTec);
89 delete vTec;
90}
91
92//
93/////////////////////////////////////////////////////////////////////////////
94void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& 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.