source: ntrip/trunk/BNC/src/t_prn.h@ 10601

Last change on this file since 10601 was 10599, checked in by stuerze, 8 days ago

ADDED: consideration of NAV type in all applications

File size: 1.9 KB
RevLine 
[5741]1#ifndef PRN_H
2#define PRN_H
3
4#include <string>
5
6class t_prn {
[6809]7public:
[9024]8 static const unsigned MAXPRN_GPS = 32;
[5741]9 static const unsigned MAXPRN_GLONASS = 26;
[6321]10 static const unsigned MAXPRN_GALILEO = 36;
[9024]11 static const unsigned MAXPRN_QZSS = 10;
12 static const unsigned MAXPRN_SBAS = 38;
13 static const unsigned MAXPRN_BDS = 65;
[10518]14 static const unsigned MAXPRN_IRNSS = 20;
[6809]15 static const unsigned MAXPRN = MAXPRN_GPS + MAXPRN_GLONASS + MAXPRN_GALILEO
[8168]16 + MAXPRN_QZSS + MAXPRN_SBAS + MAXPRN_BDS + MAXPRN_IRNSS;
[5741]17
[6809]18 t_prn() :
[10599]19 _system('G'), _number(0), _flag(0) {
[6809]20 }
21 t_prn(char system, int number) :
[10599]22 _system(system), _number(number), _flag(0) {
[6809]23 }
[5741]24
[10599]25 t_prn(char system, int number, int flag) :
26 _system(system), _number(number), _flag(flag) {
[6809]27 }
[5741]28
[6809]29 ~t_prn() {
30 }
[5741]31
[6809]32 void set(char system, int number) {
33 _system = system;
34 _number = number;
[10599]35 _flag = 0;
[6809]36 }
37
[10599]38 void set(char system, int number, int flag) {
[6809]39 _system = system;
40 _number = number;
[10599]41 _flag = flag;
[6809]42 }
43
[10599]44 void setFlag(int flag) {
45 _flag = flag;
[7004]46 }
47
[6809]48 void set(const std::string& str);
49
50 char system() const {
51 return _system;
52 }
53 int number() const {
54 return _number;
55 }
[10599]56 int flag() const {
57 return _flag;
[6809]58 }
59 int toInt() const;
[5741]60 std::string toString() const;
[6809]61 std::string toInternalString() const;
[5741]62
63 bool operator==(const t_prn& prn2) const {
[8797]64 if (_system == prn2._system &&
65 _number == prn2._number &&
[10599]66 _flag == prn2._flag) {
[5741]67 return true;
68 }
69 else {
70 return false;
71 }
72 }
73
[6812]74 /**
75 * Cleanup function resets all elements to initial state.
76 */
[6813]77 inline void clear(void) {
[6812]78 _system = 'G';
79 _number = 0;
[10599]80 _flag = 0;
[6812]81 }
82
[5741]83 operator unsigned() const;
84
[6809]85 friend std::istream& operator >>(std::istream& in, t_prn& prn);
[5741]86
[6809]87private:
[5741]88 char _system;
[10599]89 int _number;
90 int _flag;
[5741]91};
92
[6809]93std::istream& operator >>(std::istream& in, t_prn& prn);
[5741]94
95#endif
Note: See TracBrowser for help on using the repository browser.