ubuntu-location-service  0.0.2
units.h
1 /*
2  * Copyright © 2012-2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18 #ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_UNITS_UNITS_H_
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_UNITS_UNITS_H_
20 
21 #include <boost/units/cmath.hpp>
22 #include <boost/units/io.hpp>
23 #include <boost/units/quantity.hpp>
24 #include <boost/units/systems/angle/degrees.hpp>
25 #include <boost/units/systems/angle/gradians.hpp>
26 #include <boost/units/systems/si.hpp>
27 #include <boost/units/systems/si/prefixes.hpp>
28 
29 namespace com
30 {
31 namespace ubuntu
32 {
33 namespace location
34 {
35 namespace units
36 {
37 typedef boost::units::degree::plane_angle PlaneAngle;
38 static const PlaneAngle Degree;
39 static const PlaneAngle Degrees;
40 typedef boost::units::gradian::plane_angle Gradians;
41 
42 typedef boost::units::si::length Length;
43 static const Length Meter;
44 static const Length Meters;
45 
46 using boost::units::si::kilo;
47 
48 typedef boost::units::si::velocity Velocity;
49 static const Velocity MeterPerSecond;
50 static const Velocity MetersPerSecond;
51 
52 template<typename Unit>
53 using Quantity = boost::units::quantity<Unit, double>;
54 
55 typedef boost::units::si::dimensionless Dimensionless;
56 
57 using boost::units::sin;
58 using boost::units::cos;
59 using boost::units::atan2;
60 }
61 }
62 }
63 }
64 
65 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_UNITS_UNITS_H_
66