Changeset 6443 in ntrip for trunk/BNC/src/bncephuser.h


Ignore:
Timestamp:
Dec 26, 2014, 12:47:27 PM (9 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r6442 r6443  
    2626#define BNCEPHUSER_H
    2727
     28#include <deque>
    2829#include <QtCore>
    2930#include <newmat.h>
     
    3233#include "bnctime.h"
    3334#include "ephemeris.h"
    34 
    35 extern "C" {
    36 #  include "clock_orbit_rtcm.h"
    37 }
    3835
    3936class bncEphUser : public QObject {
     
    5451  const t_eph* ephLast(const QString& prn) {
    5552    if (_eph.contains(prn)) {
    56       return _eph[prn]->last;
     53      return _eph[prn].back();
    5754    }
    5855    return 0;
     
    6158  const t_eph* ephPrev(const QString& prn) {
    6259    if (_eph.contains(prn)) {
    63       return _eph[prn]->prev;
     60      unsigned nn = _eph[prn].size();
     61      if (nn > 1) {
     62        return _eph[prn].at(nn-2);
     63      }
    6464    }
    6565    return 0;
    6666  }
    6767
     68  const QList<QString> prnList() {return _eph.keys();}
     69
    6870 protected:
    6971  virtual void ephBufferChanged() {}
    7072
    71   class t_ephPair {
    72    public:
    73     t_ephPair(t_eph* lastEph) {
    74       last = lastEph;
    75       prev = 0;
    76     }
    77     ~t_ephPair() {
    78       delete last;
    79       delete prev;
    80     }
    81     t_eph* last;
    82     t_eph* prev;
    83   };
    84 
    85   QMutex                    _mutex;
    86   QMap<QString, t_ephPair*> _eph;
     73 private:
     74  QMutex                             _mutex;
     75  static const unsigned              _maxQueueSize = 5;
     76  QMap<QString, std::deque<t_eph*> > _eph;
    8777};
    8878
Note: See TracChangeset for help on using the changeset viewer.