Changeset 3562 in ntrip for trunk/BNC/RTCM/RTCM2Decoder.h


Ignore:
Timestamp:
Dec 25, 2011, 3:50:24 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM/RTCM2Decoder.h

    r2492 r3562  
    3535#include "rtcm3torinex.h"
    3636#include "ephemeris.h"
     37#include "bncephuser.h"
    3738
    38 class RTCM2Decoder: public GPSDecoder {
     39class RTCM2Decoder: public bncEphUser, public GPSDecoder {
    3940
    4041  public:
     
    4243    virtual ~RTCM2Decoder();
    4344    virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg);
    44 
    45     bool  storeEph(const gpsephemeris& gpseph, std::string& storedPRN, std::vector<int>& IODs);
    46     bool  storeEph(const t_ephGPS&     gpseph, std::string& storedPRN, std::vector<int>& IODs);
    4745
    4846    t_irc getStaCrd(double& xx, double& yy, double& zz);
     
    5755
    5856  private:
    59 
    60     class t_ephList {
    61     public:
    62       t_ephList() {}
    63      
    64       ~t_ephList() {
    65         for (std::list<t_eph*>::iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
    66           delete  (*ii);
    67         }
    68       }
    69 
    70       bool store(t_eph* eph) {
    71         if ( _eph.size() == 0 ) {
    72           _eph.push_back(eph);
    73           return true;
    74         }
    75          
    76         std::list<t_eph*>::iterator ii = _eph.begin();
    77         while (ii != _eph.end()) {
    78           if ( eph->IOD() == (*ii)->IOD() ) {
    79             return false;
    80           }
    81           if ( ! eph->isNewerThan(*ii) ) {
    82             break;
    83           }
    84           ++ii;
    85         }
    86 
    87         if ( ii == _eph.begin() && _eph.size() == MAXSIZE) {
    88           return false;
    89         }
    90 
    91         _eph.insert(ii, eph);
    92 
    93         while ( _eph.size() > MAXSIZE ) {
    94           delete _eph.front();
    95           _eph.pop_front();
    96         }
    97 
    98         return true;
    99       }
    100      
    101       const t_eph* getEph(int IOD) const {
    102         for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
    103           if ( (*ii)->IOD() == IOD ) {
    104             return (*ii);
    105           }
    106         }
    107         return 0;
    108       }
    109 
    110       void getIODs(std::vector<int>& IODs) const {
    111         IODs.clear();
    112         for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
    113           IODs.push_back((*ii)->IOD());
    114         }
    115       }
    116 
    117       static const unsigned MAXSIZE = 5;
    118 
    119       std::list<t_eph*> _eph;
    120     };
    12157
    12258    void translateCorr2Obs(std::vector<std::string>& errmsg);
     
    13672    rtcm2::RTCM2_24           _msg24;
    13773    rtcm2::RTCM2_2021         _msg2021;
    138     std::map<std::string, t_ephList*> _ephList;
    139 
    140     typedef std::map<std::string, t_ephList*> t_listMap;
    14174};
    14275
Note: See TracChangeset for help on using the changeset viewer.