astrotypes  0.0
Frequency.h
Go to the documentation of this file.
1 /*
2  * MIT License
3  *
4  * Copyright (c) 2018 PulsarSearchSoft
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
25 #include "Quantity.h"
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wall"
28 #pragma GCC diagnostic ignored "-Wpragmas"
29 #pragma GCC diagnostic ignored "-Wunused-parameter"
30 #pragma GCC diagnostic ignored "-Wunused-variable"
31 #include <boost/units/systems/si/frequency.hpp>
32 #include <boost/units/quantity.hpp>
33 #include <boost/units/make_scaled_unit.hpp>
34 #include <type_traits>
35 #pragma GCC diagnostic pop
36 
37 #ifndef ASTROTYPES_UNITS_FREQUENCY_H
38 #define ASTROTYPES_UNITS_FREQUENCY_H
39 
40 namespace pss {
41 namespace astrotypes {
42 namespace units {
43 
44 // Dimension
45 typedef boost::units::frequency_dimension Frequency;
46 
47 // Units
48 using Hertz = boost::units::si::frequency;
49 using KiloHertz = boost::units::make_scaled_unit<boost::units::si::frequency, boost::units::scale<10, boost::units::static_rational<3>>>::type;
50 using MegaHertz = boost::units::make_scaled_unit<boost::units::si::frequency, boost::units::scale<10, boost::units::static_rational<6>>>::type;
51 using GigaHertz = boost::units::make_scaled_unit<boost::units::si::frequency, boost::units::scale<10, boost::units::static_rational<9>>>::type;
52 
53 static boost::units::si::frequency const hertz = boost::units::si::hertz;
54 static boost::units::si::frequency const hz = boost::units::si::hertz;
58 
59 } // namespace units
60 } // namespace astrotypes
61 } // namespace pss
62 
63 #endif // ASTROTYPES_UNITS_FREQUENCY_H
boost::units::make_scaled_unit< boost::units::si::frequency, boost::units::scale< 10, boost::units::static_rational< 3 >>>::type KiloHertz
Definition: Frequency.h:49
boost::units::make_scaled_unit< boost::units::si::frequency, boost::units::scale< 10, boost::units::static_rational< 6 >>>::type MegaHertz
Definition: Frequency.h:50
boost::units::si::frequency Hertz
Definition: Frequency.h:48
boost::units::make_scaled_unit< boost::units::si::frequency, boost::units::scale< 10, boost::units::static_rational< 9 >>>::type GigaHertz
Definition: Frequency.h:51
BOOST_UNITS_STATIC_CONSTANT(parsecs_per_cube_cm, DispersionMeasureUnit)
boost::units::frequency_dimension Frequency
Definition: Frequency.h:45