bioformats  5.1.6
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  */
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40