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

Last change on this file since 6118 was 6107, 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 _satBiases[ii] = 0;
45 }
46}
47
48// Destructor
49/////////////////////////////////////////////////////////////////////////////
50t_pppObsPool::~t_pppObsPool() {
51 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
52 delete _satBiases[ii];
53 }
54 while (_epochs.size() > 0) {
55 delete _epochs.front();
56 _epochs.pop_front();
57 }
58}
59
60//
61/////////////////////////////////////////////////////////////////////////////
62void t_pppObsPool::putBias(t_satBias* satBias) {
63 int iPrn = satBias->_prn.toInt();
64 delete _satBiases[iPrn];
65 _satBiases[iPrn] = satBias;
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.