ome-common  5.5.0
power.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_POWER_H
48 #define OME_COMMON_UNITS_POWER_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  // Power types, constants and quantities.
65 
67  typedef si::power power_unit;
69  typedef quantity<si::power> power_quantity;
70 
72  typedef make_scaled_unit<si::power,scale<10,static_rational<-24>>>::type yoctowatt_unit;
74  typedef make_scaled_unit<si::power,scale<10,static_rational<-21>>>::type zeptowatt_unit;
76  typedef make_scaled_unit<si::power,scale<10,static_rational<-18>>>::type attowatt_unit;
78  typedef make_scaled_unit<si::power,scale<10,static_rational<-15>>>::type femtowatt_unit;
80  typedef make_scaled_unit<si::power,scale<10,static_rational<-12>>>::type picowatt_unit;
82  typedef make_scaled_unit<si::power,scale<10,static_rational< -9>>>::type nanowatt_unit;
84  typedef make_scaled_unit<si::power,scale<10,static_rational< -6>>>::type microwatt_unit;
86  typedef make_scaled_unit<si::power,scale<10,static_rational< -3>>>::type milliwatt_unit;
88  typedef make_scaled_unit<si::power,scale<10,static_rational< -2>>>::type centiwatt_unit;
90  typedef make_scaled_unit<si::power,scale<10,static_rational< -1>>>::type deciwatt_unit;
92  typedef make_scaled_unit<si::power,scale<10,static_rational< 0>>>::type watt_unit;
94  typedef make_scaled_unit<si::power,scale<10,static_rational< 1>>>::type dekawatt_unit;
96  typedef make_scaled_unit<si::power,scale<10,static_rational< 1>>>::type decawatt_unit;
98  typedef make_scaled_unit<si::power,scale<10,static_rational< 2>>>::type hectowatt_unit;
100  typedef make_scaled_unit<si::power,scale<10,static_rational< 3>>>::type kilowatt_unit;
102  typedef make_scaled_unit<si::power,scale<10,static_rational< 6>>>::type megawatt_unit;
104  typedef make_scaled_unit<si::power,scale<10,static_rational< 9>>>::type gigawatt_unit;
106  typedef make_scaled_unit<si::power,scale<10,static_rational< 12>>>::type terawatt_unit;
108  typedef make_scaled_unit<si::power,scale<10,static_rational< 15>>>::type petawatt_unit;
110  typedef make_scaled_unit<si::power,scale<10,static_rational< 18>>>::type exawatt_unit;
112  typedef make_scaled_unit<si::power,scale<10,static_rational< 21>>>::type zettawatt_unit;
114  typedef make_scaled_unit<si::power,scale<10,static_rational< 24>>>::type yottawatt_unit;
115 
117  BOOST_UNITS_STATIC_CONSTANT(yoctowatt, yoctowatt_unit);
119  BOOST_UNITS_STATIC_CONSTANT(zeptowatt, zeptowatt_unit);
121  BOOST_UNITS_STATIC_CONSTANT(attowatt, attowatt_unit);
123  BOOST_UNITS_STATIC_CONSTANT(femtowatt, femtowatt_unit);
125  BOOST_UNITS_STATIC_CONSTANT(picowatt, picowatt_unit);
127  BOOST_UNITS_STATIC_CONSTANT(nanowatt, nanowatt_unit);
129  BOOST_UNITS_STATIC_CONSTANT(microwatt, microwatt_unit);
131  BOOST_UNITS_STATIC_CONSTANT(milliwatt, milliwatt_unit);
133  BOOST_UNITS_STATIC_CONSTANT(centiwatt, centiwatt_unit);
135  BOOST_UNITS_STATIC_CONSTANT(deciwatt, deciwatt_unit);
137  BOOST_UNITS_STATIC_CONSTANT(watt, watt_unit);
139  BOOST_UNITS_STATIC_CONSTANT(dekawatt, dekawatt_unit);
141  BOOST_UNITS_STATIC_CONSTANT(decawatt, decawatt_unit);
143  BOOST_UNITS_STATIC_CONSTANT(hectowatt, hectowatt_unit);
145  BOOST_UNITS_STATIC_CONSTANT(kilowatt, kilowatt_unit);
147  BOOST_UNITS_STATIC_CONSTANT(megawatt, megawatt_unit);
149  BOOST_UNITS_STATIC_CONSTANT(gigawatt, gigawatt_unit);
151  BOOST_UNITS_STATIC_CONSTANT(terawatt, terawatt_unit);
153  BOOST_UNITS_STATIC_CONSTANT(petawatt, petawatt_unit);
155  BOOST_UNITS_STATIC_CONSTANT(exawatt, exawatt_unit);
157  BOOST_UNITS_STATIC_CONSTANT(zettawatt, zettawatt_unit);
159  BOOST_UNITS_STATIC_CONSTANT(yottawatt, yottawatt_unit);
160 
162  BOOST_UNITS_STATIC_CONSTANT(yoctowatts, yoctowatt_unit);
164  BOOST_UNITS_STATIC_CONSTANT(zeptowatts, zeptowatt_unit);
166  BOOST_UNITS_STATIC_CONSTANT(attowatts, attowatt_unit);
168  BOOST_UNITS_STATIC_CONSTANT(femtowatts, femtowatt_unit);
170  BOOST_UNITS_STATIC_CONSTANT(picowatts, picowatt_unit);
172  BOOST_UNITS_STATIC_CONSTANT(nanowatts, nanowatt_unit);
174  BOOST_UNITS_STATIC_CONSTANT(microwatts, microwatt_unit);
176  BOOST_UNITS_STATIC_CONSTANT(milliwatts, milliwatt_unit);
178  BOOST_UNITS_STATIC_CONSTANT(centiwatts, centiwatt_unit);
180  BOOST_UNITS_STATIC_CONSTANT(deciwatts, deciwatt_unit);
182  BOOST_UNITS_STATIC_CONSTANT(watts, watt_unit);
184  BOOST_UNITS_STATIC_CONSTANT(dekawatts, dekawatt_unit);
186  BOOST_UNITS_STATIC_CONSTANT(decawatts, decawatt_unit);
188  BOOST_UNITS_STATIC_CONSTANT(hectowatts, hectowatt_unit);
190  BOOST_UNITS_STATIC_CONSTANT(kilowatts, kilowatt_unit);
192  BOOST_UNITS_STATIC_CONSTANT(megawatts, megawatt_unit);
194  BOOST_UNITS_STATIC_CONSTANT(gigawatts, gigawatt_unit);
196  BOOST_UNITS_STATIC_CONSTANT(terawatts, terawatt_unit);
198  BOOST_UNITS_STATIC_CONSTANT(petawatts, petawatt_unit);
200  BOOST_UNITS_STATIC_CONSTANT(exawatts, exawatt_unit);
202  BOOST_UNITS_STATIC_CONSTANT(zettawatts, zettawatt_unit);
204  BOOST_UNITS_STATIC_CONSTANT(yottawatts, yottawatt_unit);
205 
207  typedef quantity<yoctowatt_unit> yoctowatt_quantity;
209  typedef quantity<zeptowatt_unit> zeptowatt_quantity;
211  typedef quantity<attowatt_unit> attowatt_quantity;
213  typedef quantity<femtowatt_unit> femtowatt_quantity;
215  typedef quantity<picowatt_unit> picowatt_quantity;
217  typedef quantity<nanowatt_unit> nanowatt_quantity;
219  typedef quantity<microwatt_unit> microwatt_quantity;
221  typedef quantity<milliwatt_unit> milliwatt_quantity;
223  typedef quantity<centiwatt_unit> centiwatt_quantity;
225  typedef quantity<deciwatt_unit> deciwatt_quantity;
227  typedef quantity<watt_unit> watt_quantity;
229  typedef quantity<dekawatt_unit> dekawatt_quantity;
231  typedef quantity<decawatt_unit> decawatt_quantity;
233  typedef quantity<hectowatt_unit> hectowatt_quantity;
235  typedef quantity<kilowatt_unit> kilowatt_quantity;
237  typedef quantity<megawatt_unit> megawatt_quantity;
239  typedef quantity<gigawatt_unit> gigawatt_quantity;
241  typedef quantity<terawatt_unit> terawatt_quantity;
243  typedef quantity<petawatt_unit> petawatt_quantity;
245  typedef quantity<exawatt_unit> exawatt_quantity;
247  typedef quantity<zettawatt_unit> zettawatt_quantity;
249  typedef quantity<yottawatt_unit> yottawatt_quantity;
250 
251  }
252  }
253 }
254 
255 #endif // OME_COMMON_UNITS_POWER_H
256 
257 /*
258  * Local Variables:
259  * mode:C++
260  * End:
261  */
make_scaled_unit< si::power, scale< 10, static_rational<-18 > > >::type attowatt_unit
Unit definition for attowatt power.
Definition: power.h:76
BOOST_UNITS_STATIC_CONSTANT(radian, radian_unit)
Numeric constant for radian.
quantity< petawatt_unit > petawatt_quantity
Measured quantity in petawatts.
Definition: power.h:243
quantity< deciwatt_unit > deciwatt_quantity
Measured quantity in deciwatts.
Definition: power.h:225
quantity< picowatt_unit > picowatt_quantity
Measured quantity in picowatts.
Definition: power.h:215
make_scaled_unit< si::power, scale< 10, static_rational< -2 > > >::type centiwatt_unit
Unit definition for centiwatt power.
Definition: power.h:88
make_scaled_unit< si::power, scale< 10, static_rational< 24 > > >::type yottawatt_unit
Unit definition for yottawatt power.
Definition: power.h:114
quantity< nanowatt_unit > nanowatt_quantity
Measured quantity in nanowatts.
Definition: power.h:217
quantity< si::power > power_quantity
Measured quantity (power, watts).
Definition: power.h:69
make_scaled_unit< si::power, scale< 10, static_rational<-15 > > >::type femtowatt_unit
Unit definition for femtowatt power.
Definition: power.h:78
make_scaled_unit< si::power, scale< 10, static_rational< 12 > > >::type terawatt_unit
Unit definition for terawatt power.
Definition: power.h:106
quantity< dekawatt_unit > dekawatt_quantity
Measured quantity in dekawatts.
Definition: power.h:229
make_scaled_unit< si::power, scale< 10, static_rational< -3 > > >::type milliwatt_unit
Unit definition for milliwatt power.
Definition: power.h:86
si::power power_unit
Unit definition for power.
Definition: power.h:67
quantity< kilowatt_unit > kilowatt_quantity
Measured quantity in kilowatts.
Definition: power.h:235
quantity< exawatt_unit > exawatt_quantity
Measured quantity in exawatts.
Definition: power.h:245
quantity< decawatt_unit > decawatt_quantity
Measured quantity in decawatts.
Definition: power.h:231
make_scaled_unit< si::power, scale< 10, static_rational< -9 > > >::type nanowatt_unit
Unit definition for nanowatt power.
Definition: power.h:82
make_scaled_unit< si::power, scale< 10, static_rational< 9 > > >::type gigawatt_unit
Unit definition for gigawatt power.
Definition: power.h:104
make_scaled_unit< si::power, scale< 10, static_rational< 1 > > >::type dekawatt_unit
Unit definition for dekawatt power.
Definition: power.h:94
make_scaled_unit< si::power, scale< 10, static_rational< -6 > > >::type microwatt_unit
Unit definition for microwatt power.
Definition: power.h:84
make_scaled_unit< si::power, scale< 10, static_rational< 21 > > >::type zettawatt_unit
Unit definition for zettawatt power.
Definition: power.h:112
quantity< hectowatt_unit > hectowatt_quantity
Measured quantity in hectowatts.
Definition: power.h:233
Open Microscopy Environment C++.
Definition: base64.h:48
make_scaled_unit< si::power, scale< 10, static_rational< 0 > > >::type watt_unit
Unit definition for watt power.
Definition: power.h:92
quantity< zeptowatt_unit > zeptowatt_quantity
Measured quantity in zeptowatts.
Definition: power.h:209
quantity< watt_unit > watt_quantity
Measured quantity in watts.
Definition: power.h:227
make_scaled_unit< si::power, scale< 10, static_rational< 2 > > >::type hectowatt_unit
Unit definition for hectowatt power.
Definition: power.h:98
make_scaled_unit< si::power, scale< 10, static_rational< 6 > > >::type megawatt_unit
Unit definition for megawatt power.
Definition: power.h:102
quantity< yottawatt_unit > yottawatt_quantity
Measured quantity in yottawatts.
Definition: power.h:249
quantity< femtowatt_unit > femtowatt_quantity
Measured quantity in femtowatts.
Definition: power.h:213
quantity< zettawatt_unit > zettawatt_quantity
Measured quantity in zettawatts.
Definition: power.h:247
quantity< megawatt_unit > megawatt_quantity
Measured quantity in megawatts.
Definition: power.h:237
make_scaled_unit< si::power, scale< 10, static_rational<-12 > > >::type picowatt_unit
Unit definition for picowatt power.
Definition: power.h:80
make_scaled_unit< si::power, scale< 10, static_rational< 1 > > >::type decawatt_unit
Unit definition for decawatt power.
Definition: power.h:96
quantity< yoctowatt_unit > yoctowatt_quantity
Measured quantity in yoctowatts.
Definition: power.h:207
make_scaled_unit< si::power, scale< 10, static_rational<-21 > > >::type zeptowatt_unit
Unit definition for zeptowatt power.
Definition: power.h:74
quantity< milliwatt_unit > milliwatt_quantity
Measured quantity in milliwatts.
Definition: power.h:221
make_scaled_unit< si::power, scale< 10, static_rational< 15 > > >::type petawatt_unit
Unit definition for petawatt power.
Definition: power.h:108
make_scaled_unit< si::power, scale< 10, static_rational< 3 > > >::type kilowatt_unit
Unit definition for kilowatt power.
Definition: power.h:100
quantity< centiwatt_unit > centiwatt_quantity
Measured quantity in centiwatts.
Definition: power.h:223
quantity< attowatt_unit > attowatt_quantity
Measured quantity in attowatts.
Definition: power.h:211
make_scaled_unit< si::power, scale< 10, static_rational< -1 > > >::type deciwatt_unit
Unit definition for deciwatt power.
Definition: power.h:90
make_scaled_unit< si::power, scale< 10, static_rational< 18 > > >::type exawatt_unit
Unit definition for exawatt power.
Definition: power.h:110
quantity< microwatt_unit > microwatt_quantity
Measured quantity in microwatts.
Definition: power.h:219
quantity< gigawatt_unit > gigawatt_quantity
Measured quantity in gigawatts.
Definition: power.h:239
quantity< terawatt_unit > terawatt_quantity
Measured quantity in terawatts.
Definition: power.h:241
make_scaled_unit< si::power, scale< 10, static_rational<-24 > > >::type yoctowatt_unit
Unit definition for yoctowatt power.
Definition: power.h:72