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

Last change on this file since 6812 was 6812, checked in by stoecker, 10 years ago

integrate RTCM3 parsing into BNC and directly fill target structures, add doxygen documentation

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