GLONASSTime.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 GLONASSTIME_HPP
40 #define GLONASSTIME_HPP
41 
42 #include "TimeTag.hpp"
43 
44 namespace gnsstk
45 {
47 
48 
59  class GLONASSTime : public TimeTag
60  {
61  public:
62 
69  GLONASSTime(unsigned leapCount = 0,
70  unsigned days = 0,
71  double instant = 0.,
73 
77  GLONASSTime(const GLONASSTime& right)
78  : TimeTag(right), epoch(right.epoch), day(right.day), sod(right.sod)
79  {
80  }
81 
89  GLONASSTime(const TimeTag& right)
90  {
92  }
93 
101  GLONASSTime(const CommonTime& right)
102  {
103  convertFromCommonTime(right);
104  }
105 
108  {}
109 
111  CommonTime convertToCommonTime() const override;
112 
114  void convertFromCommonTime(const CommonTime& ct) override;
115 
122  bool operator==(const GLONASSTime& right) const;
123  bool operator!=(const GLONASSTime& right) const;
124  bool operator<(const GLONASSTime& right) const;
125  bool operator>(const GLONASSTime& right) const;
126  bool operator<=(const GLONASSTime& right) const;
127  bool operator>=(const GLONASSTime& right) const;
129 
132  std::string getPrintChars() const override
133  { return "P"; }
134 
135 
137  std::string getDefaultFormat() const override
138  { return "GLONASSTime-has-no-printability-yet"; }
139 
142  std::string printf(const std::string& fmt) const override
143  { return "GLONASSTime-has-no-printability-yet"; }
144 
147  std::string printError(const std::string& fmt) const override
148  { return "GLONASSTime-has-no-printability-yet"; }
149 
154  bool setFromInfo(const IdToValue& info)
155  { return false; }
156 
158  bool isValid() const override;
159 
161  void reset() override;
162 
164  unsigned epoch;
167  unsigned day;
169  double sod;
170 
171  }; // end class GLONASSTime
172 
174 
175 } // namespace
176 
177 #endif // GLONASSTIME_HPP
gnsstk::GLONASSTime::operator>
bool operator>(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:173
gnsstk::GLONASSTime::epoch
unsigned epoch
Number of leap years since 1996 (aka N4).
Definition: GLONASSTime.hpp:164
gnsstk::GLONASSTime::printError
std::string printError(const std::string &fmt) const override
Definition: GLONASSTime.hpp:147
gnsstk::TimeTag::IdToValue
std::map< char, std::string > IdToValue
Definition: TimeTag.hpp:103
gnsstk::GLONASSTime::operator==
bool operator==(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:143
gnsstk::GLONASSTime::convertToCommonTime
CommonTime convertToCommonTime() const override
As it says, convert to a CommonTime object.
Definition: GLONASSTime.cpp:59
gnsstk::GLONASSTime::printf
std::string printf(const std::string &fmt) const override
Definition: GLONASSTime.hpp:142
gnsstk::GLONASSTime::day
unsigned day
Definition: GLONASSTime.hpp:167
gnsstk::GLONASSTime::getPrintChars
std::string getPrintChars() const override
Definition: GLONASSTime.hpp:132
gnsstk::GLONASSTime::convertFromCommonTime
void convertFromCommonTime(const CommonTime &ct) override
As it says, convert from a CommonTime object.
Definition: GLONASSTime.cpp:110
gnsstk::GLONASSTime::~GLONASSTime
~GLONASSTime()
Destructor (nothing to do).
Definition: GLONASSTime.hpp:107
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GLONASSTime::getDefaultFormat
std::string getDefaultFormat() const override
Return a string containing the default format to use in printing.
Definition: GLONASSTime.hpp:137
gnsstk::GLONASSTime
Definition: GLONASSTime.hpp:59
gnsstk::GLONASSTime::GLONASSTime
GLONASSTime(const GLONASSTime &right)
Definition: GLONASSTime.hpp:77
gnsstk::TimeTag
Definition: TimeTag.hpp:58
gnsstk::GLONASSTime::setFromInfo
bool setFromInfo(const IdToValue &info)
Definition: GLONASSTime.hpp:154
gnsstk::GLONASSTime::isValid
bool isValid() const override
Returns true if this object's members are valid, false otherwise.
Definition: GLONASSTime.cpp:214
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::GLONASSTime::operator>=
bool operator>=(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:200
gnsstk::GLONASSTime::reset
void reset() override
Reset this object to the default state.
Definition: GLONASSTime.cpp:221
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
gnsstk::GLONASSTime::GLONASSTime
GLONASSTime(const TimeTag &right)
Definition: GLONASSTime.hpp:89
gnsstk::TimeTag::convertToCommonTime
virtual CommonTime convertToCommonTime() const =0
TimeTag.hpp
gnsstk::GLONASSTime::GLONASSTime
GLONASSTime(const CommonTime &right)
Definition: GLONASSTime.hpp:101
gnsstk::TimeSystem::GLO
@ GLO
GLONASS system time (aka UTC(SU))
gnsstk::GLONASSTime::operator<
bool operator<(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:160
gnsstk::GLONASSTime::sod
double sod
Time of day (seconds of day, aka tb).
Definition: GLONASSTime.hpp:169
gnsstk::GLONASSTime::operator<=
bool operator<=(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:186
gnsstk::GLONASSTime::GLONASSTime
GLONASSTime(unsigned leapCount=0, unsigned days=0, double instant=0., TimeSystem ts=TimeSystem::GLO)
Definition: GLONASSTime.cpp:46
gnsstk::GLONASSTime::operator!=
bool operator!=(const GLONASSTime &right) const
Definition: GLONASSTime.cpp:153


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