RinexSatID.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk 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 GNSSTk 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 GNSSTk; 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-2022, 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 #ifndef GNSSTK_RINEX_SATID_HPP
40 #define GNSSTK_RINEX_SATID_HPP
41 
42 #include <iostream>
43 #include <sstream>
44 #include <iomanip>
45 
46 #include "gnsstk_export.h"
47 #include "Exception.hpp"
48 #include "SatID.hpp"
49 
56 namespace gnsstk
57 {
59 
61 
62 
63  class RinexSatID : public SatID
64  {
65  public:
67  RinexSatID() = default;
68 
70  RinexSatID(int p, SatelliteSystem s)
71  noexcept;
72 
76  RinexSatID(const std::string& str)
77  {
78  try { fromString(str); }
79  catch(Exception& e) { GNSSTK_RETHROW(e); }
80  }
81 
83  RinexSatID(const SatID& sat)
84  noexcept
85  : SatID(sat)
86  { validate(); }
87 
90  char setfill(char c)
91  noexcept
92  { char csave = fillchar; fillchar = c; return csave; }
93 
94 
96  char getfill() const
97  noexcept
98  { return fillchar; }
99 
100  // operator=, copy constructor and destructor built by compiler
101 
102 
106  char systemChar() const
107  noexcept;
108 
109  /* Return the system name as a string.
110  * @note Return only RINEX types or 'Unknown'.
111  */
112  std::string systemString() const
113  noexcept;
114 
118  std::string systemString3() const
119  noexcept;
120 
126  void fromString(const std::string& s);
127 
130  std::string toString() const
131  noexcept;
132 
133  private:
135  void validate();
136 
137  GNSSTK_EXPORT
138  static char fillchar;
139 
140  }; // class RinexSatID
141 
143  inline std::ostream& operator<<(std::ostream& s, const RinexSatID& sat)
144  {
145  s << sat.toString();
146  return s;
147  }
148 
150 
151 } // namespace gnsstk
152 
153 #endif
gnsstk::RinexSatID::RinexSatID
RinexSatID(const std::string &str)
Definition: RinexSatID.hpp:76
gnsstk::RinexSatID::fromString
void fromString(const std::string &s)
Definition: RinexSatID.cpp:122
const
#define const
Definition: getopt.c:43
gnsstk::RinexSatID::systemString
std::string systemString() const noexcept
Definition: RinexSatID.cpp:82
gnsstk::RinexSatID::systemString3
std::string systemString3() const noexcept
Definition: RinexSatID.cpp:102
gnsstk::SatelliteSystem
SatelliteSystem
Supported satellite systems.
Definition: SatelliteSystem.hpp:55
gnsstk::SatID
Definition: SatID.hpp:89
SatID.hpp
gnsstk::RinexSatID::fillchar
static GNSSTK_EXPORT char fillchar
Fill character used during stream output.
Definition: RinexSatID.hpp:138
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::RinexSatID::getfill
char getfill() const noexcept
Get the fill character used in output.
Definition: RinexSatID.hpp:96
gnsstk::RinexSatID::RinexSatID
RinexSatID()=default
Empty constructor; creates an invalid object (Unknown, ID = -1).
GNSSTK_RETHROW
#define GNSSTK_RETHROW(exc)
Definition: Exception.hpp:369
gnsstk::RinexSatID::toString
std::string toString() const noexcept
Definition: RinexSatID.cpp:204
gnsstk::RinexSatID
Definition: RinexSatID.hpp:63
Exception.hpp
std
Definition: Angle.hpp:142
gnsstk::RinexSatID::validate
void validate()
If an unsupported system is used, set to unknown and PRN -1.
Definition: RinexSatID.cpp:239
gnsstk::SatID::SatID
SatID()
Initialize with invalid data with no wildcards.
Definition: SatID.cpp:44
gnsstk::RinexSatID::setfill
char setfill(char c) noexcept
Definition: RinexSatID.hpp:90
gnsstk::RinexSatID::RinexSatID
RinexSatID(const SatID &sat) noexcept
Cast a SatID to a RinexSatID.
Definition: RinexSatID.hpp:83
gnsstk::RinexSatID::systemChar
char systemChar() const noexcept
Definition: RinexSatID.cpp:62


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:41