Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:01:47

0001 // Boost.Units - A C++ library for zero-overhead dimensional analysis and 
0002 // unit/quantity manipulation and conversion
0003 //
0004 // Copyright (C) 2003-2008 Matthias Christian Schabel
0005 // Copyright (C) 2008 Steven Watanabe
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See
0008 // accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_UNITS_ABSTRACT_HPP
0012 #define BOOST_UNITS_ABSTRACT_HPP
0013 
0014 #include <string>
0015 
0016 #include <boost/units/conversion.hpp>
0017 #include <boost/units/unit.hpp>
0018 
0019 #include <boost/units/make_system.hpp>
0020 #include <boost/units/base_unit.hpp>
0021 
0022 #include <boost/units/physical_dimensions/amount.hpp>
0023 #include <boost/units/physical_dimensions/current.hpp>
0024 #include <boost/units/physical_dimensions/length.hpp>
0025 #include <boost/units/physical_dimensions/luminous_intensity.hpp>
0026 #include <boost/units/physical_dimensions/mass.hpp>
0027 #include <boost/units/physical_dimensions/plane_angle.hpp>
0028 #include <boost/units/physical_dimensions/solid_angle.hpp>
0029 #include <boost/units/physical_dimensions/temperature.hpp>
0030 #include <boost/units/physical_dimensions/time.hpp>
0031 
0032 namespace boost {
0033 
0034 namespace units {
0035 
0036 namespace abstract {
0037 
0038 struct length_unit_tag : base_unit<length_unit_tag, length_dimension, -30> { };
0039 struct mass_unit_tag : base_unit<mass_unit_tag, mass_dimension, -29> { };
0040 struct time_unit_tag : base_unit<time_unit_tag, time_dimension, -28> { };
0041 struct current_unit_tag : base_unit<current_unit_tag, current_dimension, -27> { };
0042 struct temperature_unit_tag : base_unit<temperature_unit_tag, temperature_dimension, -26> { };
0043 struct amount_unit_tag : base_unit<amount_unit_tag, amount_dimension, -25> { };
0044 struct luminous_intensity_unit_tag : base_unit<luminous_intensity_unit_tag, luminous_intensity_dimension, -24> { };
0045 struct plane_angle_unit_tag : base_unit<plane_angle_unit_tag, plane_angle_dimension, -23> { };
0046 struct solid_angle_unit_tag : base_unit<solid_angle_unit_tag, solid_angle_dimension, -22> { };
0047 
0048 typedef make_system<
0049     length_unit_tag,
0050     mass_unit_tag,
0051     time_unit_tag,
0052     current_unit_tag,
0053     temperature_unit_tag,
0054     amount_unit_tag,
0055     luminous_intensity_unit_tag,
0056     plane_angle_unit_tag,
0057     solid_angle_unit_tag
0058 >::type system;
0059 
0060 typedef unit<length_dimension,system>                length;                 ///< abstract unit of length
0061 typedef unit<mass_dimension,system>                  mass;                   ///< abstract unit of mass
0062 typedef unit<time_dimension,system>                  time;                   ///< abstract unit of time
0063 typedef unit<current_dimension,system>               current;                ///< abstract unit of current
0064 typedef unit<temperature_dimension,system>           temperature;            ///< abstract unit of temperature
0065 typedef unit<amount_dimension,system>                amount;                 ///< abstract unit of amount
0066 typedef unit<luminous_intensity_dimension,system>    luminous_intensity;     ///< abstract unit of luminous intensity
0067 typedef unit<plane_angle_dimension,system>           plane_angle;            ///< abstract unit of plane angle
0068 typedef unit<solid_angle_dimension,system>           solid_angle;            ///< abstract unit of solid angle
0069 
0070 } // namespace abstract
0071 
0072 template<> 
0073 struct base_unit_info<abstract::length_unit_tag> 
0074 { 
0075     static std::string name()       { return "[Length]"; }
0076     static std::string symbol()     { return "[L]"; }
0077 };
0078 
0079 template<> 
0080 struct base_unit_info<abstract::mass_unit_tag> 
0081 { 
0082     static std::string name()       { return "[Mass]"; }
0083     static std::string symbol()     { return "[M]"; }
0084 };
0085 
0086 template<> 
0087 struct base_unit_info<abstract::time_unit_tag> 
0088 { 
0089     static std::string name()       { return "[Time]"; }
0090     static std::string symbol()     { return "[T]"; }
0091 };
0092 
0093 template<> 
0094 struct base_unit_info<abstract::current_unit_tag> 
0095 { 
0096     static std::string name()       { return "[Electric Current]"; }
0097     static std::string symbol()     { return "[I]"; }
0098 };
0099 
0100 template<> 
0101 struct base_unit_info<abstract::temperature_unit_tag> 
0102 { 
0103     static std::string name()       { return "[Temperature]"; }
0104     static std::string symbol()     { return "[Theta]"; }
0105 };
0106 
0107 template<> 
0108 struct base_unit_info<abstract::amount_unit_tag> 
0109 { 
0110     static std::string name()       { return "[Amount]"; }
0111     static std::string symbol()     { return "[N]"; }
0112 };
0113 
0114 template<> 
0115 struct base_unit_info<abstract::luminous_intensity_unit_tag> 
0116 { 
0117     static std::string name()       { return "[Luminous Intensity]"; }
0118     static std::string symbol()     { return "[J]"; }
0119 };
0120 
0121 template<> 
0122 struct base_unit_info<abstract::plane_angle_unit_tag> 
0123 { 
0124     static std::string name()       { return "[Plane Angle]"; }
0125     static std::string symbol()     { return "[QP]"; }
0126 };
0127 
0128 template<> 
0129 struct base_unit_info<abstract::solid_angle_unit_tag> 
0130 { 
0131     static std::string name()       { return "[Solid Angle]"; }
0132     static std::string symbol()     { return "[QS]"; }
0133 };
0134 
0135 } // namespace units
0136 
0137 } // namespace boost
0138 
0139 #endif // BOOST_UNITS_ABSTRACT_HPP