ome-common  5.2.0
frequency.h
Go to the documentation of this file.
1 /*
2  * #%L
3  * OME-COMMON C++ library for C++ compatibility/portability
4  * %%
5  * Copyright © 2015 Open Microscopy Environment:
6  * - Massachusetts Institute of Technology
7  * - National Institutes of Health
8  * - University of Dundee
9  * - Board of Regents of the University of Wisconsin-Madison
10  * - Glencoe Software, Inc.
11  * %%
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * The views and conclusions contained in the software and documentation are
34  * those of the authors and should not be interpreted as representing official
35  * policies, either expressed or implied, of any organization.
36  * #L%
37  */
38 
47 #ifndef OME_COMMON_UNITS_FREQUENCY_H
48 #define OME_COMMON_UNITS_FREQUENCY_H
49 
50 #include <ome/common/config.h>
51 #include <ome/common/units/types.h>
52 
53 #include <boost/units/unit.hpp>
54 #include <boost/units/quantity.hpp>
55 #include <boost/units/systems/si.hpp>
56 
57 namespace ome
58 {
59  namespace common
60  {
61  namespace units
62  {
63 
64  // Frequency types, constants and quantities.
65 
67  typedef si::frequency frequency_unit;
69  typedef quantity<si::frequency> frequency_quantity;
70 
72  typedef make_scaled_unit<si::frequency,scale<10,static_rational<-24> > >::type yoctohertz_unit;
74  typedef make_scaled_unit<si::frequency,scale<10,static_rational<-21> > >::type zeptohertz_unit;
76  typedef make_scaled_unit<si::frequency,scale<10,static_rational<-18> > >::type attohertz_unit;
78  typedef make_scaled_unit<si::frequency,scale<10,static_rational<-15> > >::type femtohertz_unit;
80  typedef make_scaled_unit<si::frequency,scale<10,static_rational<-12> > >::type picohertz_unit;
82  typedef make_scaled_unit<si::frequency,scale<10,static_rational< -9> > >::type nanohertz_unit;
84  typedef make_scaled_unit<si::frequency,scale<10,static_rational< -6> > >::type microhertz_unit;
86  typedef make_scaled_unit<si::frequency,scale<10,static_rational< -3> > >::type millihertz_unit;
88  typedef make_scaled_unit<si::frequency,scale<10,static_rational< -2> > >::type centihertz_unit;
90  typedef make_scaled_unit<si::frequency,scale<10,static_rational< -1> > >::type decihertz_unit;
92  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 0> > >::type hertz_unit;
94  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 1> > >::type dekahertz_unit;
96  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 1> > >::type decahertz_unit;
98  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 2> > >::type hectohertz_unit;
100  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 3> > >::type kilohertz_unit;
102  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 6> > >::type megahertz_unit;
104  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 9> > >::type gigahertz_unit;
106  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 12> > >::type terahertz_unit;
108  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 15> > >::type petahertz_unit;
110  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 18> > >::type exahertz_unit;
112  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 21> > >::type zettahertz_unit;
114  typedef make_scaled_unit<si::frequency,scale<10,static_rational< 24> > >::type yottahertz_unit;
115 
117  BOOST_UNITS_STATIC_CONSTANT(yoctohertz, yoctohertz_unit);
119  BOOST_UNITS_STATIC_CONSTANT(zeptohertz, zeptohertz_unit);
121  BOOST_UNITS_STATIC_CONSTANT(attohertz, attohertz_unit);
123  BOOST_UNITS_STATIC_CONSTANT(femtohertz, femtohertz_unit);
125  BOOST_UNITS_STATIC_CONSTANT(picohertz, picohertz_unit);
127  BOOST_UNITS_STATIC_CONSTANT(nanohertz, nanohertz_unit);
129  BOOST_UNITS_STATIC_CONSTANT(microhertz, microhertz_unit);
131  BOOST_UNITS_STATIC_CONSTANT(millihertz, millihertz_unit);
133  BOOST_UNITS_STATIC_CONSTANT(centihertz, centihertz_unit);
135  BOOST_UNITS_STATIC_CONSTANT(decihertz, decihertz_unit);
137  BOOST_UNITS_STATIC_CONSTANT(hertz, hertz_unit);
139  BOOST_UNITS_STATIC_CONSTANT(dekahertz, dekahertz_unit);
141  BOOST_UNITS_STATIC_CONSTANT(decahertz, decahertz_unit);
143  BOOST_UNITS_STATIC_CONSTANT(hectohertz, hectohertz_unit);
145  BOOST_UNITS_STATIC_CONSTANT(kilohertz, kilohertz_unit);
147  BOOST_UNITS_STATIC_CONSTANT(megahertz, megahertz_unit);
149  BOOST_UNITS_STATIC_CONSTANT(gigahertz, gigahertz_unit);
151  BOOST_UNITS_STATIC_CONSTANT(terahertz, terahertz_unit);
153  BOOST_UNITS_STATIC_CONSTANT(petahertz, petahertz_unit);
155  BOOST_UNITS_STATIC_CONSTANT(exahertz, exahertz_unit);
157  BOOST_UNITS_STATIC_CONSTANT(zettahertz, zettahertz_unit);
159  BOOST_UNITS_STATIC_CONSTANT(yottahertz, yottahertz_unit);
160 
162  typedef quantity<yoctohertz_unit> yoctohertz_quantity;
164  typedef quantity<zeptohertz_unit> zeptohertz_quantity;
166  typedef quantity<attohertz_unit> attohertz_quantity;
168  typedef quantity<femtohertz_unit> femtohertz_quantity;
170  typedef quantity<picohertz_unit> picohertz_quantity;
172  typedef quantity<nanohertz_unit> nanohertz_quantity;
174  typedef quantity<microhertz_unit> microhertz_quantity;
176  typedef quantity<millihertz_unit> millihertz_quantity;
178  typedef quantity<centihertz_unit> centihertz_quantity;
180  typedef quantity<decihertz_unit> decihertz_quantity;
182  typedef quantity<hertz_unit> hertz_quantity;
184  typedef quantity<dekahertz_unit> dekahertz_quantity;
186  typedef quantity<decahertz_unit> decahertz_quantity;
188  typedef quantity<hectohertz_unit> hectohertz_quantity;
190  typedef quantity<kilohertz_unit> kilohertz_quantity;
192  typedef quantity<megahertz_unit> megahertz_quantity;
194  typedef quantity<gigahertz_unit> gigahertz_quantity;
196  typedef quantity<terahertz_unit> terahertz_quantity;
198  typedef quantity<petahertz_unit> petahertz_quantity;
200  typedef quantity<exahertz_unit> exahertz_quantity;
202  typedef quantity<zettahertz_unit> zettahertz_quantity;
204  typedef quantity<yottahertz_unit> yottahertz_quantity;
205 
206  }
207  }
208 }
209 
210 #endif // OME_COMMON_UNITS_FREQUENCY_H
211 
212 /*
213  * Local Variables:
214  * mode:C++
215  * End:
216  */
make_scaled_unit< si::frequency, scale< 10, static_rational< 9 > > >::type gigahertz_unit
Unit definition for gigahertz frequency.
Definition: frequency.h:104
quantity< yottahertz_unit > yottahertz_quantity
Measured quantity in yottahertz.
Definition: frequency.h:204
make_scaled_unit< si::frequency, scale< 10, static_rational<-15 > > >::type femtohertz_unit
Unit definition for femtohertz frequency.
Definition: frequency.h:78
make_scaled_unit< si::frequency, scale< 10, static_rational< -9 > > >::type nanohertz_unit
Unit definition for nanohertz frequency.
Definition: frequency.h:82
quantity< hectohertz_unit > hectohertz_quantity
Measured quantity in hectohertz.
Definition: frequency.h:188
quantity< nanohertz_unit > nanohertz_quantity
Measured quantity in nanohertz.
Definition: frequency.h:172
quantity< si::frequency > frequency_quantity
Measured quantity (frequency, hertz).
Definition: frequency.h:69
quantity< megahertz_unit > megahertz_quantity
Measured quantity in megahertz.
Definition: frequency.h:192
quantity< decahertz_unit > decahertz_quantity
Measured quantity in decahertz.
Definition: frequency.h:186
quantity< terahertz_unit > terahertz_quantity
Measured quantity in terahertz.
Definition: frequency.h:196
make_scaled_unit< si::frequency, scale< 10, static_rational<-18 > > >::type attohertz_unit
Unit definition for attohertz frequency.
Definition: frequency.h:76
quantity< zettahertz_unit > zettahertz_quantity
Measured quantity in zettahertz.
Definition: frequency.h:202
quantity< exahertz_unit > exahertz_quantity
Measured quantity in exahertz.
Definition: frequency.h:200
make_scaled_unit< si::frequency, scale< 10, static_rational< 1 > > >::type dekahertz_unit
Unit definition for dekahertz frequency.
Definition: frequency.h:94
quantity< femtohertz_unit > femtohertz_quantity
Measured quantity in femtohertz.
Definition: frequency.h:168
quantity< kilohertz_unit > kilohertz_quantity
Measured quantity in kilohertz.
Definition: frequency.h:190
make_scaled_unit< si::frequency, scale< 10, static_rational< 18 > > >::type exahertz_unit
Unit definition for exahertz frequency.
Definition: frequency.h:110
quantity< millihertz_unit > millihertz_quantity
Measured quantity in millihertz.
Definition: frequency.h:176
make_scaled_unit< si::frequency, scale< 10, static_rational<-24 > > >::type yoctohertz_unit
Unit definition for yoctohertz frequency.
Definition: frequency.h:72
quantity< zeptohertz_unit > zeptohertz_quantity
Measured quantity in zeptohertz.
Definition: frequency.h:164
make_scaled_unit< si::frequency, scale< 10, static_rational< -1 > > >::type decihertz_unit
Unit definition for decihertz frequency.
Definition: frequency.h:90
quantity< microhertz_unit > microhertz_quantity
Measured quantity in microhertz.
Definition: frequency.h:174
make_scaled_unit< si::frequency, scale< 10, static_rational< 12 > > >::type terahertz_unit
Unit definition for terahertz frequency.
Definition: frequency.h:106
quantity< petahertz_unit > petahertz_quantity
Measured quantity in petahertz.
Definition: frequency.h:198
make_scaled_unit< si::frequency, scale< 10, static_rational< 24 > > >::type yottahertz_unit
Unit definition for yottahertz frequency.
Definition: frequency.h:114
quantity< decihertz_unit > decihertz_quantity
Measured quantity in decihertz.
Definition: frequency.h:180
make_scaled_unit< si::frequency, scale< 10, static_rational< -6 > > >::type microhertz_unit
Unit definition for microhertz frequency.
Definition: frequency.h:84
make_scaled_unit< si::frequency, scale< 10, static_rational< -3 > > >::type millihertz_unit
Unit definition for millihertz frequency.
Definition: frequency.h:86
si::frequency frequency_unit
Unit definition for frequency.
Definition: frequency.h:67
Definition: boolean.h:48
quantity< dekahertz_unit > dekahertz_quantity
Measured quantity in dekahertz.
Definition: frequency.h:184
make_scaled_unit< si::frequency, scale< 10, static_rational< 1 > > >::type decahertz_unit
Unit definition for decahertz frequency.
Definition: frequency.h:96
make_scaled_unit< si::frequency, scale< 10, static_rational< 0 > > >::type hertz_unit
Unit definition for hertz frequency.
Definition: frequency.h:92
make_scaled_unit< si::frequency, scale< 10, static_rational< 21 > > >::type zettahertz_unit
Unit definition for zettahertz frequency.
Definition: frequency.h:112
make_scaled_unit< si::frequency, scale< 10, static_rational< 6 > > >::type megahertz_unit
Unit definition for megahertz frequency.
Definition: frequency.h:102
make_scaled_unit< si::frequency, scale< 10, static_rational< 3 > > >::type kilohertz_unit
Unit definition for kilohertz frequency.
Definition: frequency.h:100
make_scaled_unit< si::frequency, scale< 10, static_rational<-12 > > >::type picohertz_unit
Unit definition for picohertz frequency.
Definition: frequency.h:80
quantity< picohertz_unit > picohertz_quantity
Measured quantity in picohertz.
Definition: frequency.h:170
make_scaled_unit< si::frequency, scale< 10, static_rational< -2 > > >::type centihertz_unit
Unit definition for centihertz frequency.
Definition: frequency.h:88
quantity< centihertz_unit > centihertz_quantity
Measured quantity in centihertz.
Definition: frequency.h:178
make_scaled_unit< si::frequency, scale< 10, static_rational< 2 > > >::type hectohertz_unit
Unit definition for hectohertz frequency.
Definition: frequency.h:98
quantity< hertz_unit > hertz_quantity
Measured quantity in hertz.
Definition: frequency.h:182
quantity< gigahertz_unit > gigahertz_quantity
Measured quantity in gigahertz.
Definition: frequency.h:194
make_scaled_unit< si::frequency, scale< 10, static_rational< 15 > > >::type petahertz_unit
Unit definition for petahertz frequency.
Definition: frequency.h:108
make_scaled_unit< si::frequency, scale< 10, static_rational<-21 > > >::type zeptohertz_unit
Unit definition for zeptohertz frequency.
Definition: frequency.h:74
quantity< attohertz_unit > attohertz_quantity
Measured quantity in attohertz.
Definition: frequency.h:166
quantity< yoctohertz_unit > yoctohertz_quantity
Measured quantity in yoctohertz.
Definition: frequency.h:162
BOOST_UNITS_STATIC_CONSTANT(radian, radian_unit)
Numeric constant for radian.