RinexClockBase.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 
44 #ifndef GNSSTK_RINEXCLOCKBASE_HPP
45 #define GNSSTK_RINEXCLOCKBASE_HPP
46 
47 #include <string>
48 #include "FFData.hpp"
49 #include "StringUtils.hpp"
50 #include "CivilTime.hpp"
51 #include "FormattedDouble.hpp"
52 #include "gnsstk_export.h"
53 
54 namespace gnsstk
55 {
57 
58 
60  class RinexClockBase : public FFData
61  {
62  public:
65  class RCDouble : public FormattedDouble
66  {
67  public:
69  RCDouble(double d)
70  : FormattedDouble(d, StringUtils::FFLead::Zero, 13, 2, 19, 'E',
71  StringUtils::FFSign::NegOnly,
72  StringUtils::FFAlign::Right)
73  {}
74 
76  RCDouble& operator=(const std::string& s)
77  { FormattedDouble::operator=(s); return *this; }
78  };
79 
81  virtual ~RinexClockBase() {}
82 
84  struct RinexClkType
85  {
86  std::string type;
87  std::string description;
88  RinexClkType() : type(std::string("UN")),
89  description(std::string("Unknown or Invalid")){}
90  RinexClkType(std::string t, std::string d) : type(t), description(d){}
91  bool operator==(const RinexClkType &other) const
92  { return (StringUtils::upperCase(type) ==
94  }
95  bool operator!=(const RinexClkType &other) const
96  { return !(*this == other); }
97  bool operator<(const RinexClkType &other) const
98  { return (type < other.type); }
99  bool operator<=(const RinexClkType &other) const
100  { return (type <= other.type); }
101  bool operator>(const RinexClkType &other) const
102  { return (type > other.type); }
103  bool operator>=(const RinexClkType &other) const
104  { return (type >= other.type); }
105  };
106 
110  GNSSTK_EXPORT static const RinexClkType UN;
111  GNSSTK_EXPORT static const RinexClkType AR;
112  GNSSTK_EXPORT static const RinexClkType AS;
113  GNSSTK_EXPORT static const RinexClkType CR;
114  GNSSTK_EXPORT static const RinexClkType DR;
115  GNSSTK_EXPORT static const RinexClkType MS;
117 
118  protected:
119 
124  std::string writeTime(const CivilTime& dt) const;
125 
131  CivilTime parseTime(const std::string& line) const;
132 
133  }; // RinexClockBase
135 
136 } // namespace
137 
138 #endif
gnsstk::RinexClockBase::DR
static const GNSSTK_EXPORT RinexClkType DR
Definition: RinexClockBase.hpp:114
gnsstk::FFData
Definition: FFData.hpp:87
gnsstk::RinexClockBase::parseTime
CivilTime parseTime(const std::string &line) const
Definition: RinexClockBase.cpp:84
gnsstk::StringUtils::upperCase
std::string & upperCase(std::string &s)
Definition: StringUtils.hpp:2117
gnsstk::RinexClockBase::RinexClkType::RinexClkType
RinexClkType()
Definition: RinexClockBase.hpp:88
gnsstk::FormattedDouble::operator=
FormattedDouble & operator=(const FormattedDouble &right)=default
Copy assignment.
gnsstk::RinexClockBase::RCDouble
Definition: RinexClockBase.hpp:65
gnsstk::RinexClockBase::AR
static const GNSSTK_EXPORT RinexClkType AR
Definition: RinexClockBase.hpp:111
StringUtils.hpp
gnsstk::RinexClockBase::RinexClkType
RINEX clock data types.
Definition: RinexClockBase.hpp:84
gnsstk::RinexClockBase::RinexClkType::type
std::string type
Definition: RinexClockBase.hpp:86
gnsstk::RinexClockBase::RinexClkType::RinexClkType
RinexClkType(std::string t, std::string d)
Definition: RinexClockBase.hpp:90
gnsstk::RinexClockBase::RinexClkType::operator<=
bool operator<=(const RinexClkType &other) const
Definition: RinexClockBase.hpp:99
gnsstk::RinexClockBase
Provide a base class for RinexClockData and RinexClockHeader.
Definition: RinexClockBase.hpp:60
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::StringUtils::FFAlign::Right
@ Right
Formatted output will be right-aligned.
gnsstk::StringUtils::FFLead
FFLead
Leading character for floatFormat(), after any whitespace or sign.
Definition: StringUtils.hpp:109
gnsstk::RinexClockBase::CR
static const GNSSTK_EXPORT RinexClkType CR
Definition: RinexClockBase.hpp:113
gnsstk::FormattedDouble
Definition: FormattedDouble.hpp:70
gnsstk::StringUtils::FFSign::NegOnly
@ NegOnly
Prefix output with a minus sign (neg) or nothing (pos)
gnsstk::StringUtils::FFLead::Zero
@ Zero
Start with zero, e.g. 0.12345.
gnsstk::RinexClockBase::UN
static const GNSSTK_EXPORT RinexClkType UN
Definition: RinexClockBase.hpp:110
gnsstk::RinexClockBase::AS
static const GNSSTK_EXPORT RinexClkType AS
Definition: RinexClockBase.hpp:112
gnsstk::RinexClockBase::RinexClkType::operator>=
bool operator>=(const RinexClkType &other) const
Definition: RinexClockBase.hpp:103
gnsstk::RinexClockBase::RCDouble::RCDouble
RCDouble(double d)
Constructor for a value, with all defaults for format.
Definition: RinexClockBase.hpp:69
gnsstk::RinexClockBase::RinexClkType::description
std::string description
Definition: RinexClockBase.hpp:87
CivilTime.hpp
gnsstk::RinexClockBase::RinexClkType::operator<
bool operator<(const RinexClkType &other) const
Definition: RinexClockBase.hpp:97
FormattedDouble.hpp
gnsstk::RinexClockBase::RinexClkType::operator!=
bool operator!=(const RinexClkType &other) const
Definition: RinexClockBase.hpp:95
gnsstk::CivilTime
Definition: CivilTime.hpp:55
gnsstk::RinexClockBase::RinexClkType::operator>
bool operator>(const RinexClkType &other) const
Definition: RinexClockBase.hpp:101
gnsstk::RinexClockBase::~RinexClockBase
virtual ~RinexClockBase()
Destructor.
Definition: RinexClockBase.hpp:81
std
Definition: Angle.hpp:142
gnsstk::StringUtils::FFSign
FFSign
How to handle sign in floatFormat()
Definition: StringUtils.hpp:117
gnsstk::RinexClockBase::RCDouble::operator=
RCDouble & operator=(const std::string &s)
Assign a value by decoding a string using existing formatting.
Definition: RinexClockBase.hpp:76
FFData.hpp
gnsstk::RinexClockBase::writeTime
std::string writeTime(const CivilTime &dt) const
Definition: RinexClockBase.cpp:59
gnsstk::RinexClockBase::MS
static const GNSSTK_EXPORT RinexClkType MS
Definition: RinexClockBase.hpp:115
gnsstk::StringUtils::FFAlign
FFAlign
Alignment of data for floatFormat()
Definition: StringUtils.hpp:125
gnsstk::RinexClockBase::RinexClkType::operator==
bool operator==(const RinexClkType &other) const
Definition: RinexClockBase.hpp:91


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