1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_UNITS_ABSTRACT_HPP
12 #define BOOST_UNITS_ABSTRACT_HPP
16 #include <boost/units/conversion.hpp>
17 #include <boost/units/unit.hpp>
19 #include <boost/units/make_system.hpp>
20 #include <boost/units/base_unit.hpp>
22 #include <boost/units/physical_dimensions/amount.hpp>
23 #include <boost/units/physical_dimensions/current.hpp>
24 #include <boost/units/physical_dimensions/length.hpp>
25 #include <boost/units/physical_dimensions/luminous_intensity.hpp>
26 #include <boost/units/physical_dimensions/mass.hpp>
27 #include <boost/units/physical_dimensions/plane_angle.hpp>
28 #include <boost/units/physical_dimensions/solid_angle.hpp>
29 #include <boost/units/physical_dimensions/temperature.hpp>
30 #include <boost/units/physical_dimensions/time.hpp>
38 struct length_unit_tag
: base_unit
<length_unit_tag
, length_dimension
, -30> { };
39 struct mass_unit_tag
: base_unit
<mass_unit_tag
, mass_dimension
, -29> { };
40 struct time_unit_tag
: base_unit
<time_unit_tag
, time_dimension
, -28> { };
41 struct current_unit_tag
: base_unit
<current_unit_tag
, current_dimension
, -27> { };
42 struct temperature_unit_tag
: base_unit
<temperature_unit_tag
, temperature_dimension
, -26> { };
43 struct amount_unit_tag
: base_unit
<amount_unit_tag
, amount_dimension
, -25> { };
44 struct luminous_intensity_unit_tag
: base_unit
<luminous_intensity_unit_tag
, luminous_intensity_dimension
, -24> { };
45 struct plane_angle_unit_tag
: base_unit
<plane_angle_unit_tag
, plane_angle_dimension
, -23> { };
46 struct solid_angle_unit_tag
: base_unit
<solid_angle_unit_tag
, solid_angle_dimension
, -22> { };
55 luminous_intensity_unit_tag
,
60 typedef unit
<length_dimension
,system
> length
; ///< abstract unit of length
61 typedef unit
<mass_dimension
,system
> mass
; ///< abstract unit of mass
62 typedef unit
<time_dimension
,system
> time
; ///< abstract unit of time
63 typedef unit
<current_dimension
,system
> current
; ///< abstract unit of current
64 typedef unit
<temperature_dimension
,system
> temperature
; ///< abstract unit of temperature
65 typedef unit
<amount_dimension
,system
> amount
; ///< abstract unit of amount
66 typedef unit
<luminous_intensity_dimension
,system
> luminous_intensity
; ///< abstract unit of luminous intensity
67 typedef unit
<plane_angle_dimension
,system
> plane_angle
; ///< abstract unit of plane angle
68 typedef unit
<solid_angle_dimension
,system
> solid_angle
; ///< abstract unit of solid angle
70 } // namespace abstract
73 struct base_unit_info
<abstract::length_unit_tag
>
75 static std::string
name() { return "[Length]"; }
76 static std::string
symbol() { return "[L]"; }
80 struct base_unit_info
<abstract::mass_unit_tag
>
82 static std::string
name() { return "[Mass]"; }
83 static std::string
symbol() { return "[M]"; }
87 struct base_unit_info
<abstract::time_unit_tag
>
89 static std::string
name() { return "[Time]"; }
90 static std::string
symbol() { return "[T]"; }
94 struct base_unit_info
<abstract::current_unit_tag
>
96 static std::string
name() { return "[Electric Current]"; }
97 static std::string
symbol() { return "[I]"; }
101 struct base_unit_info
<abstract::temperature_unit_tag
>
103 static std::string
name() { return "[Temperature]"; }
104 static std::string
symbol() { return "[Theta]"; }
108 struct base_unit_info
<abstract::amount_unit_tag
>
110 static std::string
name() { return "[Amount]"; }
111 static std::string
symbol() { return "[N]"; }
115 struct base_unit_info
<abstract::luminous_intensity_unit_tag
>
117 static std::string
name() { return "[Luminous Intensity]"; }
118 static std::string
symbol() { return "[J]"; }
122 struct base_unit_info
<abstract::plane_angle_unit_tag
>
124 static std::string
name() { return "[Plane Angle]"; }
125 static std::string
symbol() { return "[QP]"; }
129 struct base_unit_info
<abstract::solid_angle_unit_tag
>
131 static std::string
name() { return "[Solid Angle]"; }
132 static std::string
symbol() { return "[QS]"; }
139 #endif // BOOST_UNITS_ABSTRACT_HPP