YDSTime.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_YDSTIME_HPP
40 #define GNSSTK_YDSTIME_HPP
41 
42 #include "gnsstk_export.h"
43 #include "TimeTag.hpp"
44 #include "Exception.hpp"
45 #include "TimeConstants.hpp"
46 #include "TimeSystem.hpp"
47 
48 
49 namespace gnsstk
50 {
52 
53 
58  class YDSTime : public TimeTag
59  {
60  public:
69  GNSSTK_EXPORT static const YDSTime BEGIN_TIME;
70 
72 
80  YDSTime( long y = 0,
81  long d = 0,
82  double s = 0.,
84  : year(y), doy(d), sod(s)
85  { timeSystem = ts; }
86 
90  YDSTime( const YDSTime& right )
91  : year( right.year ), doy( right.doy ), sod( right.sod )
92  { timeSystem = right.timeSystem; }
93 
101  YDSTime( const TimeTag& right )
102  {
104  }
105 
113  YDSTime( const CommonTime& right )
114  {
115  convertFromCommonTime( right );
116  }
117 
123  YDSTime& operator=( const YDSTime& right );
124 
126  virtual ~YDSTime()
127  {}
129 
130  // The following functions are required by TimeTag.
131  virtual CommonTime convertToCommonTime() const;
132 
133  virtual void convertFromCommonTime( const CommonTime& ct );
134 
137  virtual std::string printf( const std::string& fmt ) const;
138 
141  virtual std::string printError( const std::string& fmt ) const;
142 
149  virtual bool setFromInfo( const IdToValue& info );
150 
153  virtual std::string getPrintChars() const
154  {
155  return "YyjsP";
156  }
157 
159  virtual std::string getDefaultFormat() const
160  {
161  return "%04Y/%03j %s %P";
162  }
163 
164  virtual bool isValid() const;
165 
166  virtual void reset();
167 
176  bool operator==( const YDSTime& right ) const;
177  bool operator!=( const YDSTime& right ) const;
178  bool operator<( const YDSTime& right ) const;
179  bool operator>( const YDSTime& right ) const;
180  bool operator<=( const YDSTime& right ) const;
181  bool operator>=( const YDSTime& right ) const;
183 
184  int year;
185  int doy;
186  double sod;
187  };
188 
189 
191 
192 } // namespace
193 
194  // -----------YDSTime operator<< -----------
195  //
202 std::ostream& operator<<( std::ostream& s,
203  const gnsstk::YDSTime& yt );
204 
205 #endif // GNSSTK_YDSTIME_HPP
gnsstk::YDSTime::convertFromCommonTime
virtual void convertFromCommonTime(const CommonTime &ct)
Definition: YDSTime.cpp:76
TimeSystem.hpp
gnsstk::YDSTime::printError
virtual std::string printError(const std::string &fmt) const
Definition: YDSTime.cpp:113
TimeConstants.hpp
gnsstk::YDSTime::YDSTime
YDSTime(const TimeTag &right)
Definition: YDSTime.hpp:101
gnsstk::YDSTime::operator==
bool operator==(const YDSTime &right) const
Definition: YDSTime.cpp:207
gnsstk::TimeTag::IdToValue
std::map< char, std::string > IdToValue
Definition: TimeTag.hpp:103
gnsstk::YDSTime
Definition: YDSTime.hpp:58
gnsstk::YDSTime::reset
virtual void reset()
Reset this object to the default state.
Definition: YDSTime.cpp:200
gnsstk::YDSTime::operator>=
bool operator>=(const YDSTime &right) const
Definition: YDSTime.cpp:273
gnsstk::TimeSystem::Unknown
@ Unknown
unknown time frame; for legacy code compatibility
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::YDSTime::isValid
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
Definition: YDSTime.cpp:189
gnsstk::TimeTag::timeSystem
TimeSystem timeSystem
time system (representation) of the data
Definition: TimeTag.hpp:204
gnsstk::YDSTime::operator=
YDSTime & operator=(const YDSTime &right)
Definition: YDSTime.cpp:52
gnsstk::TimeTag
Definition: TimeTag.hpp:58
y
page HOWTO subpage DoxygenGuide Documenting Your Code page DoxygenGuide Documenting Your Code todo Flesh out this document section doctips Tips for Documenting When defining make sure that the prototype is identical between the cpp and hpp including both the namespaces and the parameter names for you have std::string as the return type in the hpp file and string as the return type in the cpp Doxygen may get confused and autolink to the cpp version with no documentation If you don t use the same parameter names between the cpp and hpp that will also confuse Doxygen Don t put type information in return or param documentation It doesn t really add anything and will often cause Doxygen to complain and not produce the documentation< br > use note Do not put a comma after a param name unless you mean to document multiple parameters< br/> the output stream</code >< br/> y
Definition: DOCUMENTING.dox:15
gnsstk::YDSTime::~YDSTime
virtual ~YDSTime()
Virtual Destructor.
Definition: YDSTime.hpp:126
gnsstk::YDSTime::doy
int doy
Definition: YDSTime.hpp:185
gnsstk::YDSTime::YDSTime
YDSTime(long y=0, long d=0, double s=0., TimeSystem ts=TimeSystem::Unknown)
Definition: YDSTime.hpp:80
gnsstk::YDSTime::year
int year
Definition: YDSTime.hpp:184
gnsstk::YDSTime::YDSTime
YDSTime(const YDSTime &right)
Definition: YDSTime.hpp:90
gnsstk::YDSTime::BEGIN_TIME
static const GNSSTK_EXPORT YDSTime BEGIN_TIME
Definition: YDSTime.hpp:69
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::YDSTime::getPrintChars
virtual std::string getPrintChars() const
Definition: YDSTime.hpp:153
gnsstk::YDSTime::operator<
bool operator<(const YDSTime &right) const
Definition: YDSTime.cpp:229
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
gnsstk::YDSTime::setFromInfo
virtual bool setFromInfo(const IdToValue &info)
Definition: YDSTime.cpp:138
gnsstk::YDSTime::sod
double sod
Definition: YDSTime.hpp:186
gnsstk::TimeTag::convertToCommonTime
virtual CommonTime convertToCommonTime() const =0
TimeTag.hpp
gnsstk::YDSTime::convertToCommonTime
virtual CommonTime convertToCommonTime() const
Definition: YDSTime.cpp:61
Exception.hpp
gnsstk::YDSTime::getDefaultFormat
virtual std::string getDefaultFormat() const
Return a string containing the default format to use in printing.
Definition: YDSTime.hpp:159
gnsstk::YDSTime::operator<=
bool operator<=(const YDSTime &right) const
Definition: YDSTime.cpp:268
gnsstk::YDSTime::operator>
bool operator>(const YDSTime &right) const
Definition: YDSTime.cpp:263
gnsstk::YDSTime::YDSTime
YDSTime(const CommonTime &right)
Definition: YDSTime.hpp:113
operator<<
std::ostream & operator<<(std::ostream &s, const gnsstk::YDSTime &yt)
Definition: YDSTime.cpp:280
gnsstk::YDSTime::operator!=
bool operator!=(const YDSTime &right) const
Definition: YDSTime.cpp:224
gnsstk::YDSTime::printf
virtual std::string printf(const std::string &fmt) const
Definition: YDSTime.cpp:88


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