Changeset 10791 in ntrip for trunk/BNC/src/satObs.h


Ignore:
Timestamp:
Dec 3, 2025, 5:37:16 PM (42 hours ago)
Author:
mervart
Message:

BNC Multifrequency and PPPAR Client (initial version)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/satObs.h

    r10599 r10791  
    3131    _lockTimeIndicator = -1;
    3232  }
     33  char frqChar() const {return _rnxType2ch.length() > 0 ? _rnxType2ch[0] : '?';}
     34  char trkChar() const {return _rnxType2ch.length() > 1 ? _rnxType2ch[1] : '?';}
    3335  std::string       _rnxType2ch;
    3436  double            _code;
     
    5355    _type = 0;
    5456  }
    55   t_satObs(const t_satObs& old) { // copy constructor (deep copy)
    56     _staID = old._staID;
    57     _prn   = old._prn;
    58     _time  = old._time;
    59     _type  = old._type;
    60     for (unsigned ii = 0; ii < old._obs.size(); ii++) {
    61       _obs.push_back(new t_frqObs(*old._obs[ii]));
     57  t_satObs(const t_satObs& other) { // copy constructor (deep copy)
     58    copyFields(other);
     59  }
     60  t_satObs operator=(const t_satObs& other) {
     61    if (this != &other) {
     62      copyFields(other);
    6263    }
     64    return *this;
    6365  }
    6466  /**
     
    7375   */
    7476  inline void clear(void) {
    75     for (unsigned ii = 0; ii < _obs.size(); ii++)
     77    for (unsigned ii = 0; ii < _obs.size(); ii++) {
    7678      delete _obs[ii];
     79    }
    7780    _obs.clear();
    7881    _obs.resize(0);
     
    8891  int                    _type; // MT
    8992  std::vector<t_frqObs*> _obs;
     93
     94 private:
     95  void copyFields(const t_satObs& other) {
     96    _staID = other._staID;
     97    _prn   = other._prn;
     98    _time  = other._time;
     99    _type  = other._type;
     100    for (unsigned ii = 0; ii < other._obs.size(); ii++) {
     101      _obs.push_back(new t_frqObs(*other._obs[ii]));
     102    }
     103  }
    90104};
    91105
Note: See TracChangeset for help on using the changeset viewer.