1 //==============================================================================
2 //
3 //  This file is part of GPSTk, the GPS Toolkit.
4 //
5 //  The GPSTk is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU Lesser General Public License as published
7 //  by the Free Software Foundation; either version 3.0 of the License, or
8 //  any later version.
9 //
10 //  The GPSTk is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU Lesser General Public License for more details.
14 //
15 //  You should have received a copy of the GNU Lesser General Public
16 //  License along with GPSTk; if not, write to the Free Software Foundation,
17 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 //  This software was developed by Applied Research Laboratories at the
20 //  University of Texas at Austin.
21 //  Copyright 2004-2020, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 //  This software was developed by Applied Research Laboratories at the
28 //  University of Texas at Austin, under contract to an agency or agencies
29 //  within the U.S. Department of Defense. The U.S. Government retains all
30 //  rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 //  Pursuant to DoD Directive 523024
33 //
34 //  DISTRIBUTION STATEMENT A: This software has been approved for public
35 //                            release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 /**
40  * @file DDid.hpp
41  * Include file defining DDid - double difference identification, a class to handle
42  * the bookkeeping of double differences.
43  */
44 
45 #ifndef CLASS_DOUB_DIFF_ID_INCLUDE
46 #define CLASS_DOUB_DIFF_ID_INCLUDE
47 
48 //------------------------------------------------------------------------------------
49 // system includes
50 #include <string>
51 #include <ostream>
52 
53 // GPSTk
54 #include "Exception.hpp"
55 // Geomatics
56 #include "GSatID.hpp"
57 
58 namespace gpstk {
59 //------------------------------------------------------------------------------------
60 // double difference identification
61 class DDid {
62 public:
63    std::string site1,site2;
64    gpstk::GSatID sat1,sat2;
65    int ssite,ssat;
66       // empty constructor - sites are empty and sats are GPS,-1
67    //DDid(void);
68       // explicit constructor - do not reorder
69    explicit DDid(std::string s1,
70                  std::string s2,
71                  gpstk::GSatID p1,
72                  gpstk::GSatID p2);
73 
74       // 'less than' is required for map<DDid,...>.find(DDid)
75    bool operator<(const DDid& right) const;
76    bool operator>(const DDid& right) const;
77    bool operator==(const DDid& right) const;
78    bool operator!=(const DDid& right) const;
79 
80    // return 0 if either is invalid
81    // return +1 if the same, -1 if the same except for one switch
82    // return +2 if left is greater than right
83    // return -2 if left is less than right
84    static int compare(const DDid& left, const DDid& right);
85 
86    friend std::ostream& operator<<(std::ostream& s, const DDid& t);
87 
88 };
89 
90 //------------------------------------------------------------------------------------
91 // single difference id
92 class SDid {
93 public:
94    std::string site1,site2;
95    gpstk::GSatID sat;
96    int ssite;
97       // empty constructor - sites are empty and sat is GPS,-1
98    //SDid(void);
99       // explicit constructor - do not reorder
100    explicit SDid(std::string s1,
101                  std::string s2,
102                  gpstk::GSatID p);
103 
104    bool operator<(const SDid& right) const;
105    bool operator>(const SDid& right) const;
106    bool operator==(const SDid& right) const;
107 
108    // return 0 if either is invalid
109    // return +1 if the same, -1 if the same except for one switch
110    // return +2 if left is greater than right
111    // return -2 if left is less than right
112    static int compare(const SDid& left, const SDid& right);
113 
114    friend std::ostream& operator<<(std::ostream& s, const SDid& t);
115 };
116 
117 //------------------------------------------------------------------------------------
118 // one-way data id
119 class OWid {
120 public:
121    std::string site;
122    gpstk::GSatID sat;
123       // empty constructor - site is empty and sat is GPS,-1
124    //OWid(void);
125       // explicit constructor - do not reorder
126    explicit OWid(std::string& s1, gpstk::GSatID& p);
127 
128    bool operator<(const OWid& right) const;
129    bool operator>(const OWid& right) const;
130    bool operator==(const OWid& right) const;
131 
132    // return 0 if either is invalid
133    // return +1 if the same
134    // return +2 if left is greater than right
135    // return -2 if left is less than right
136    static int compare(const OWid& left, const OWid& right);
137 
138    friend std::ostream& operator<<(std::ostream& s, const OWid& t);
139 };
140 
141 }  // end namespace gpstk
142 //------------------------------------------------------------------------------------
143 #endif
144