[5741] | 1 | #ifndef PRN_H
|
---|
| 2 | #define PRN_H
|
---|
| 3 |
|
---|
| 4 | #include <string>
|
---|
| 5 |
|
---|
| 6 | class t_prn {
|
---|
[6809] | 7 | public:
|
---|
[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;
|
---|
| 14 | static const unsigned MAXPRN_IRNSS = 7;
|
---|
[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() :
|
---|
| 19 | _system('G'), _number(0), _flags(0) {
|
---|
| 20 | }
|
---|
| 21 | t_prn(char system, int number) :
|
---|
| 22 | _system(system), _number(number), _flags(0) {
|
---|
| 23 | }
|
---|
[5741] | 24 |
|
---|
[6809] | 25 | t_prn(char system, int number, int flags) :
|
---|
| 26 | _system(system), _number(number), _flags(flags) {
|
---|
| 27 | }
|
---|
[5741] | 28 |
|
---|
[6809] | 29 | ~t_prn() {
|
---|
| 30 | }
|
---|
[5741] | 31 |
|
---|
[6809] | 32 | void set(char system, int number) {
|
---|
| 33 | _system = system;
|
---|
| 34 | _number = number;
|
---|
| 35 | _flags = 0;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | void set(char system, int number, int flags) {
|
---|
| 39 | _system = system;
|
---|
| 40 | _number = number;
|
---|
| 41 | _flags = flags;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[7004] | 44 | void setFlags(int flags) {
|
---|
| 45 | _flags = flags;
|
---|
| 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 | }
|
---|
| 56 | int flags() const {
|
---|
| 57 | return _flags;
|
---|
| 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 &&
|
---|
| 66 | _flags == prn2._flags) {
|
---|
[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;
|
---|
[6813] | 80 | _flags = 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] | 87 | private:
|
---|
[5741] | 88 | char _system;
|
---|
[6809] | 89 | int _number;
|
---|
| 90 | int _flags;
|
---|
[5741] | 91 | };
|
---|
| 92 |
|
---|
[6809] | 93 | std::istream& operator >>(std::istream& in, t_prn& prn);
|
---|
[5741] | 94 |
|
---|
| 95 | #endif
|
---|