Line | |
---|
1 | #ifndef PRN_H
|
---|
2 | #define PRN_H
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 |
|
---|
6 | class t_prn {
|
---|
7 | public:
|
---|
8 | static const unsigned MAXPRN_GPS = 32;
|
---|
9 | static const unsigned MAXPRN_GLONASS = 26;
|
---|
10 | static const unsigned MAXPRN = MAXPRN_GPS + MAXPRN_GLONASS;
|
---|
11 |
|
---|
12 | t_prn() : _system('G'), _number(0) {}
|
---|
13 | t_prn(char system, int number) : _system(system), _number(number) {}
|
---|
14 |
|
---|
15 | ~t_prn() {};
|
---|
16 |
|
---|
17 | void set(char system, int number) {_system = system; _number = number;}
|
---|
18 | void set(const std::string& str);
|
---|
19 |
|
---|
20 | char system() const {return _system;}
|
---|
21 | int number() const {return _number;}
|
---|
22 | int toInt() const;
|
---|
23 | std::string toString() const;
|
---|
24 |
|
---|
25 | bool operator==(const t_prn& prn2) const {
|
---|
26 | if (_system == prn2._system && _number == prn2._number) {
|
---|
27 | return true;
|
---|
28 | }
|
---|
29 | else {
|
---|
30 | return false;
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | operator unsigned() const;
|
---|
35 |
|
---|
36 | friend std::istream& operator >> (std::istream& in, t_prn& prn);
|
---|
37 |
|
---|
38 | private:
|
---|
39 | char _system;
|
---|
40 | int _number;
|
---|
41 | };
|
---|
42 |
|
---|
43 | std::istream& operator >> (std::istream& in, t_prn& prn);
|
---|
44 |
|
---|
45 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.