WeekSecond.hpp
Go to the documentation of this file.
1 //============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 //==============================================================================
6 //
7 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
8 //
9 // The GNSSTk is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published
11 // by the Free Software Foundation; either version 3.0 of the License, or
12 // any later version.
13 //
14 // The GNSSTk is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with GNSSTk; if not, write to the Free Software Foundation,
21 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
22 //
23 // This software was developed by Applied Research Laboratories at the
24 // University of Texas at Austin.
25 // Copyright 2004-2022, The Board of Regents of The University of Texas System
26 //
27 //==============================================================================
28 
29 //==============================================================================
30 //
31 // This software was developed by Applied Research Laboratories at the
32 // University of Texas at Austin, under contract to an agency or agencies
33 // within the U.S. Department of Defense. The U.S. Government retains all
34 // rights to use, duplicate, distribute, disclose, or release this software.
35 //
36 // Pursuant to DoD Directive 523024
37 //
38 // DISTRIBUTION STATEMENT A: This software has been approved for public
39 // release, distribution is unlimited.
40 //
41 //==============================================================================
42 
45 
46 #ifndef GNSSTK_WEEKSECOND_HPP
47 #define GNSSTK_WEEKSECOND_HPP
48 
49 #include "Week.hpp"
50 #include "TimeConstants.hpp"
51 #include "TimeSystem.hpp"
52 
53 namespace gnsstk
54 {
56 
57 
60  class WeekSecond : public Week
61  {
62  public:
63 
69 
74  WeekSecond(unsigned int w = 0,
75  double s = 0.,
77  : Week(w), sow(s)
78  { timeSystem = ts; }
79 
84  WeekSecond( const WeekSecond& right )
85  : Week( right ), sow( right.sow )
86  { timeSystem = right.timeSystem; }
87 
95  WeekSecond( const TimeTag& right )
96  {
98  }
99 
107  WeekSecond( const CommonTime& right )
108  {
109  convertFromCommonTime( right );
110  }
111 
117  WeekSecond& operator=( const WeekSecond& right );
118 
120  virtual ~WeekSecond()
121  {}
123 
124  // The following functions are required by TimeTag.
125 
126  virtual CommonTime convertToCommonTime() const;
127 
128  virtual void convertFromCommonTime( const CommonTime& ct );
129 
130  virtual bool isValid() const;
131 
132  virtual void reset();
133 
134  inline virtual unsigned int getDayOfWeek() const
135  {
136  return static_cast<unsigned int>(sow) / SEC_PER_DAY;
137  }
138 
139  inline double getSOW() const { return sow; }
140 
147  bool operator==( const WeekSecond& right ) const;
148  bool operator!=( const WeekSecond& right ) const;
149  bool operator<( const WeekSecond& right ) const;
150  bool operator>( const WeekSecond& right ) const;
151  bool operator<=( const WeekSecond& right ) const;
152  bool operator>=( const WeekSecond& right ) const;
154 
155  double sow;
156  };
157 
159 
160 }
161 
162 #endif // GNSSTK_WEEKSECOND_HPP
TimeSystem.hpp
gnsstk::WeekSecond::WeekSecond
WeekSecond(const CommonTime &right)
Definition: WeekSecond.hpp:107
gnsstk::WeekSecond::WeekSecond
WeekSecond(const WeekSecond &right)
Definition: WeekSecond.hpp:84
gnsstk::WeekSecond::convertToCommonTime
virtual CommonTime convertToCommonTime() const
Definition: WeekSecond.cpp:55
TimeConstants.hpp
gnsstk::WeekSecond::getSOW
double getSOW() const
Definition: WeekSecond.hpp:139
gnsstk::WeekSecond::WeekSecond
WeekSecond(unsigned int w=0, double s=0., TimeSystem ts=TimeSystem::Unknown)
Definition: WeekSecond.hpp:74
gnsstk::WeekSecond::operator==
bool operator==(const WeekSecond &right) const
Definition: WeekSecond.cpp:111
gnsstk::SEC_PER_DAY
const long SEC_PER_DAY
Seconds per day.
Definition: TimeConstants.hpp:63
gnsstk::WeekSecond::convertFromCommonTime
virtual void convertFromCommonTime(const CommonTime &ct)
Definition: WeekSecond.cpp:78
gnsstk::WeekSecond::~WeekSecond
virtual ~WeekSecond()
Virtual Destructor.
Definition: WeekSecond.hpp:120
gnsstk::Week
Definition: Week.hpp:81
gnsstk::WeekSecond::operator>=
bool operator>=(const WeekSecond &right) const
Definition: WeekSecond.cpp:149
Week.hpp
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::WeekSecond::getDayOfWeek
virtual unsigned int getDayOfWeek() const
Force this interface on this classes descendants.
Definition: WeekSecond.hpp:134
gnsstk::WeekSecond::reset
virtual void reset()
Reset this object to the default state.
Definition: WeekSecond.cpp:105
gnsstk::WeekSecond::isValid
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
Definition: WeekSecond.cpp:99
gnsstk::TimeTag
Definition: TimeTag.hpp:58
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::WeekSecond::sow
double sow
Definition: WeekSecond.hpp:155
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
gnsstk::WeekSecond::operator<
bool operator<(const WeekSecond &right) const
Definition: WeekSecond.cpp:122
gnsstk::TimeTag::convertToCommonTime
virtual CommonTime convertToCommonTime() const =0
gnsstk::WeekSecond
Definition: WeekSecond.hpp:60
gnsstk::WeekSecond::operator>
bool operator>(const WeekSecond &right) const
Definition: WeekSecond.cpp:139
gnsstk::WeekSecond::operator<=
bool operator<=(const WeekSecond &right) const
Definition: WeekSecond.cpp:144
gnsstk::WeekSecond::operator=
WeekSecond & operator=(const WeekSecond &right)
Definition: WeekSecond.cpp:48
gnsstk::WeekSecond::operator!=
bool operator!=(const WeekSecond &right) const
Definition: WeekSecond.cpp:117
gnsstk::WeekSecond::WeekSecond
WeekSecond(const TimeTag &right)
Definition: WeekSecond.hpp:95


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