ANSITime.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 
40 
41 #ifndef GNSSTK_ANSITIME_HPP
42 #define GNSSTK_ANSITIME_HPP
43 
44 #include "TimeTag.hpp"
45 #include "TimeSystem.hpp"
46 
47 namespace gnsstk
48 {
50 
51 
56  class ANSITime : public TimeTag
57  {
58  public:
63 
68  ANSITime( time_t t = 0,
69  const TimeSystem& ts = TimeSystem::Unknown )
70  : time(t)
71  { timeSystem = ts; }
72 
77  ANSITime( const ANSITime& right )
78  : time( right.time )
79  { timeSystem = right.timeSystem; }
80 
88  ANSITime( const TimeTag& right )
89  {
91  }
92 
100  ANSITime( const CommonTime& right )
101  {
102  convertFromCommonTime( right );
103  }
104 
110  ANSITime& operator=( const ANSITime& right );
111 
113  virtual ~ANSITime()
114  noexcept
115  {}
117 
118  // The following functions are required by TimeTag.
119  virtual CommonTime convertToCommonTime() const;
120 
121  virtual void convertFromCommonTime( const CommonTime& ct );
122 
125  virtual std::string printf( const std::string& fmt ) const;
126 
129  virtual std::string printError( const std::string& fmt ) const;
130 
137  virtual bool setFromInfo( const IdToValue& info );
138 
141  virtual std::string getPrintChars() const
142  {
143  return "KP";
144  }
145 
147  virtual std::string getDefaultFormat() const
148  {
149  return "%K %P";
150  }
151 
152  virtual bool isValid() const;
153 
154  virtual void reset() ;
155 
164  bool operator==( const ANSITime& right ) const;
165  bool operator!=( const ANSITime& right ) const;
166  bool operator<( const ANSITime& right ) const;
167  bool operator>( const ANSITime& right ) const;
168  bool operator<=( const ANSITime& right ) const;
169  bool operator>=( const ANSITime& right ) const;
171 
172  time_t time;
173  };
174 
176 
177 } // namespace
178 
179 #endif // GNSSTK_ANSITIME_HPP
TimeSystem.hpp
gnsstk::ANSITime::operator>
bool operator>(const ANSITime &right) const
Definition: ANSITime.cpp:209
gnsstk::TimeTag::IdToValue
std::map< char, std::string > IdToValue
Definition: TimeTag.hpp:103
gnsstk::ANSITime::getDefaultFormat
virtual std::string getDefaultFormat() const
Return a string containing the default format to use in printing.
Definition: ANSITime.hpp:147
gnsstk::ANSITime::ANSITime
ANSITime(const TimeTag &right)
Definition: ANSITime.hpp:88
gnsstk::ANSITime::ANSITime
ANSITime(const ANSITime &right)
Definition: ANSITime.hpp:77
gnsstk::ANSITime::operator<
bool operator<(const ANSITime &right) const
Definition: ANSITime.cpp:195
gnsstk::ANSITime::printf
virtual std::string printf(const std::string &fmt) const
Definition: ANSITime.cpp:94
gnsstk::TimeSystem::Unknown
@ Unknown
unknown time frame; for legacy code compatibility
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::TimeTag::timeSystem
TimeSystem timeSystem
time system (representation) of the data
Definition: TimeTag.hpp:204
gnsstk::TimeTag
Definition: TimeTag.hpp:58
gnsstk::ANSITime::setFromInfo
virtual bool setFromInfo(const IdToValue &info)
Definition: ANSITime.cpp:132
gnsstk::ANSITime::printError
virtual std::string printError(const std::string &fmt) const
Definition: ANSITime.cpp:113
gnsstk::ANSITime::convertFromCommonTime
virtual void convertFromCommonTime(const CommonTime &ct)
Definition: ANSITime.cpp:71
gnsstk::ANSITime::~ANSITime
virtual ~ANSITime() noexcept
Virtual Destructor.
Definition: ANSITime.hpp:113
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::ANSITime::ANSITime
ANSITime(const CommonTime &right)
Definition: ANSITime.hpp:100
gnsstk::ANSITime::time
time_t time
Definition: ANSITime.hpp:172
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
gnsstk::TimeTag::convertToCommonTime
virtual CommonTime convertToCommonTime() const =0
TimeTag.hpp
gnsstk::ANSITime::reset
virtual void reset()
Reset this object to the default state.
Definition: ANSITime.cpp:168
gnsstk::ANSITime
Definition: ANSITime.hpp:56
gnsstk::ANSITime::operator<=
bool operator<=(const ANSITime &right) const
Definition: ANSITime.cpp:214
gnsstk::ANSITime::getPrintChars
virtual std::string getPrintChars() const
Definition: ANSITime.hpp:141
gnsstk::ANSITime::convertToCommonTime
virtual CommonTime convertToCommonTime() const
Definition: ANSITime.cpp:54
gnsstk::ANSITime::isValid
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
Definition: ANSITime.cpp:157
gnsstk::ANSITime::operator!=
bool operator!=(const ANSITime &right) const
Definition: ANSITime.cpp:190
gnsstk::ANSITime::ANSITime
ANSITime(time_t t=0, const TimeSystem &ts=TimeSystem::Unknown)
Definition: ANSITime.hpp:68
gnsstk::ANSITime::operator=
ANSITime & operator=(const ANSITime &right)
Definition: ANSITime.cpp:47
gnsstk::ANSITime::operator==
bool operator==(const ANSITime &right) const
Definition: ANSITime.cpp:174
gnsstk::ANSITime::operator>=
bool operator>=(const ANSITime &right) const
Definition: ANSITime.cpp:220


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