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

Last change on this file since 6898 was 6463, checked in by mervart, 10 years ago
File size: 2.1 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}
47
48// Destructor
49/////////////////////////////////////////////////////////////////////////////
50t_pppObsPool::~t_pppObsPool() {
51 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
52 delete _satCodeBiases[ii];
53 }
54 while (_epochs.size() > 0) {
55 delete _epochs.front();
56 _epochs.pop_front();
57 }
58}
59
60//
61/////////////////////////////////////////////////////////////////////////////
62void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
63 int iPrn = satCodeBias->_prn.toInt();
64 delete _satCodeBiases[iPrn];
65 _satCodeBiases[iPrn] = satCodeBias;
66}
67
68//
69/////////////////////////////////////////////////////////////////////////////
70void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
71 const unsigned MAXSIZE = 2;
72 _epochs.push_back(new t_epoch(epoTime, obsVector));
73 if (_epochs.size() > MAXSIZE) {
74 delete _epochs.front();
75 _epochs.pop_front();
76 }
77}
Note: See TracBrowser for help on using the repository browser.