1 //==============================================================================
2 //
3 //  This file is part of GPSTk, the GPS Toolkit.
4 //
5 //  The GPSTk 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 GPSTk 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 GPSTk; 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-2020, 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 /// @file IERSConvention.hpp
40 /// Include file defining the IERSConvention class.
41 
42 #ifndef CLASS_IERSCONVENTION_INCLUDE
43 #define CLASS_IERSCONVENTION_INCLUDE
44 
45 #include <iostream>
46 #include <string>
47 #include "Exception.hpp"
48 
49 namespace gpstk
50 {
51 
52       /** This enum encapsulates the choice of IERS Convention, which
53        * applies directly to the operation of class EarthOrientation,
54        * and is used in class SolarSystem and in the functions defined
55        * in SolidEarthTides.cpp.  The IERS convention determines the
56        * precise form of frame transformations between the
57        * conventional terrestrial frame and the conventional inertial
58        * frame, as well as the solid earth tides.
59        *
60        * References:
61        * IERS1996: IERS Technical Note 21, "IERS Conventions (1996),"
62        *   Dennis D. McCarthy, U.S. Naval Observatory, 1996.
63        * IERS2003: IERS Technical Note 32, "IERS Conventions (2003),"
64        *   Dennis D. McCarthy and Gerard Petit eds., U.S. Naval Observatory and
65        *   Bureau International des Poids et Mesures, 2004.
66        * IERS2010: IERS Technical Note 36, "IERS Conventions (2010),"
67        *   Gerard Petit and Brian Luzum eds., Bureau International des
68        *   Poids et Mesures and U.S. Naval Observatory, 2010.
69        */
70    enum class IERSConvention
71    {
72       Unknown = 0,      // 0 MUST be first
73       IERS1996,
74       IERS2003,
75       IERS2010,
76       Last          // the number of conventions; this must be last
77    };
78 
79    namespace StringUtils
80    {
81          /// Convert a IERSConvention enum to its string representation.
82       std::string asString(IERSConvention e);
83          /// Convert a string representation of IERSConvention to an enum.
84       IERSConvention asIERSConvention(const std::string& s);
85    }
86 
87       /** Write name (asString()) of a Convention to an output stream.
88        * @param[in,out] os The output stream
89        * @param[in] cv The Convention to be written
90        * @return reference to the output stream */
operator <<(std::ostream & os,IERSConvention cv)91    inline std::ostream& operator<<(std::ostream& os, IERSConvention cv)
92    { return os << StringUtils::asString(cv); }
93 
94 } // end namespace gpstk
95 
96 #endif  // define CLASS_IERSCONVENTION_INCLUDE
97