MJD.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_MJD_HPP
40 #define GNSSTK_MJD_HPP
41 
42 #include "TimeTag.hpp"
43 #include "TimeSystem.hpp"
44 
45 namespace gnsstk
46 {
48 
49 
54  class MJD : public TimeTag
55  {
56  public:
66  MJD( long double m = 0.,
68  : mjd( m )
69  { timeSystem = ts; }
70 
75  MJD( const MJD& right )
76  : mjd( right.mjd )
77  { timeSystem = right.timeSystem; }
78 
86  MJD( const TimeTag& right )
87  {
89  }
90 
98  MJD( const CommonTime& right )
99  {
100  convertFromCommonTime( right );
101  }
102 
108  MJD& operator=( const MJD& right );
109 
111  virtual ~MJD()
112  {}
114 
115  // The following functions are required by TimeTag.
116  virtual CommonTime convertToCommonTime() const;
117 
118  virtual void convertFromCommonTime( const CommonTime& ct );
119 
122  virtual std::string printf( const std::string& fmt ) const;
123 
126  virtual std::string printError( const std::string& fmt ) const;
127 
134  virtual bool setFromInfo( const IdToValue& info );
135 
138  virtual std::string getPrintChars() const
139  {
140  return "QP";
141  }
142 
144  virtual std::string getDefaultFormat() const
145  {
146  return "%.9Q %P";
147  }
148 
149  virtual bool isValid() const;
150 
151  virtual void reset();
152 
161  bool operator==( const MJD& right ) const;
162  bool operator!=( const MJD& right ) const;
163  bool operator<( const MJD& right ) const;
164  bool operator>( const MJD& right ) const;
165  bool operator<=( const MJD& right ) const;
166  bool operator>=( const MJD& right ) const;
168 
169  long double mjd;
170  };
171 
173 
174 } // namespace
175 
176 #endif // GNSSTK_MJD_HPP
TimeSystem.hpp
gnsstk::MJD::getPrintChars
virtual std::string getPrintChars() const
Definition: MJD.hpp:138
gnsstk::MJD::reset
virtual void reset()
Reset this object to the default state.
Definition: MJD.cpp:169
gnsstk::TimeTag::IdToValue
std::map< char, std::string > IdToValue
Definition: TimeTag.hpp:103
gnsstk::MJD::printError
virtual std::string printError(const std::string &fmt) const
Definition: MJD.cpp:114
gnsstk::MJD::MJD
MJD(const MJD &right)
Definition: MJD.hpp:75
gnsstk::MJD::setFromInfo
virtual bool setFromInfo(const IdToValue &info)
Definition: MJD.cpp:133
gnsstk::MJD::operator!=
bool operator!=(const MJD &right) const
Definition: MJD.cpp:190
gnsstk::MJD::operator<=
bool operator<=(const MJD &right) const
Definition: MJD.cpp:218
gnsstk::TimeSystem::Unknown
@ Unknown
unknown time frame; for legacy code compatibility
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::MJD::~MJD
virtual ~MJD()
Virtual Destructor.
Definition: MJD.hpp:111
gnsstk::TimeTag::timeSystem
TimeSystem timeSystem
time system (representation) of the data
Definition: TimeTag.hpp:204
gnsstk::MJD::operator<
bool operator<(const MJD &right) const
Definition: MJD.cpp:195
gnsstk::TimeTag
Definition: TimeTag.hpp:58
gnsstk::MJD::operator==
bool operator==(const MJD &right) const
Definition: MJD.cpp:175
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::MJD::operator=
MJD & operator=(const MJD &right)
Definition: MJD.cpp:47
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
gnsstk::MJD::MJD
MJD(const TimeTag &right)
Definition: MJD.hpp:86
gnsstk::TimeTag::convertToCommonTime
virtual CommonTime convertToCommonTime() const =0
gnsstk::MJD::isValid
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
Definition: MJD.cpp:158
TimeTag.hpp
gnsstk::MJD::convertFromCommonTime
virtual void convertFromCommonTime(const CommonTime &ct)
Definition: MJD.cpp:84
gnsstk::MJD::mjd
long double mjd
Definition: MJD.hpp:169
gnsstk::MJD::convertToCommonTime
virtual CommonTime convertToCommonTime() const
Definition: MJD.cpp:54
gnsstk::MJD::operator>=
bool operator>=(const MJD &right) const
Definition: MJD.cpp:224
gnsstk::MJD::MJD
MJD(const CommonTime &right)
Definition: MJD.hpp:98
gnsstk::MJD::MJD
MJD(long double m=0., TimeSystem ts=TimeSystem::Unknown)
Definition: MJD.hpp:66
gnsstk::MJD::printf
virtual std::string printf(const std::string &fmt) const
Definition: MJD.cpp:95
gnsstk::MJD
Definition: MJD.hpp:54
gnsstk::MJD::getDefaultFormat
virtual std::string getDefaultFormat() const
Return a string containing the default format to use in printing.
Definition: MJD.hpp:144
gnsstk::MJD::operator>
bool operator>(const MJD &right) const
Definition: MJD.cpp:213


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