Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/systems/si/io.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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_SI_IO_HPP
0012 #define BOOST_UNITS_SI_IO_HPP
0013 
0014 #include <boost/units/io.hpp>
0015 #include <boost/units/reduce_unit.hpp>
0016 
0017 #include <boost/units/systems/si.hpp>
0018 
0019 namespace boost {
0020 
0021 namespace units { 
0022 
0023 // gray and sievert are indistinguishable
0024 inline std::string name_string(const reduce_unit<si::absorbed_dose>::type&) { return "gray"; }
0025 inline std::string symbol_string(const reduce_unit<si::absorbed_dose>::type&) { return "Gy"; }
0026 
0027 // activity and frequency are indistinguishable - would need a "decays" base unit
0028 //inline std::string name_string(const si::activity&) { return "becquerel"; }
0029 //inline std::string symbol_string(const si::activity&) { return "Bq"; }
0030 
0031 inline std::string name_string(const reduce_unit<si::capacitance>::type&)   { return "farad"; }
0032 inline std::string symbol_string(const reduce_unit<si::capacitance>::type&) { return "F"; }
0033 
0034 inline std::string name_string(const reduce_unit<si::catalytic_activity>::type&) { return "katal"; }
0035 inline std::string symbol_string(const reduce_unit<si::catalytic_activity>::type&) { return "kat"; }
0036 
0037 inline std::string name_string(const reduce_unit<si::conductance>::type&) { return "siemen"; }
0038 inline std::string symbol_string(const reduce_unit<si::conductance>::type&) { return "S"; }
0039 
0040 // gray and sievert are indistinguishable
0041 //inline std::string name_string(const si::dose_equivalent&) { return "sievert"; }
0042 //inline std::string symbol_string(const si::dose_equivalent&) { return "Sv"; }
0043 
0044 inline std::string name_string(const reduce_unit<si::electric_charge>::type&) { return "coulomb"; }
0045 inline std::string symbol_string(const reduce_unit<si::electric_charge>::type&) { return "C"; }
0046 
0047 inline std::string name_string(const reduce_unit<si::electric_potential>::type&) { return "volt"; }
0048 inline std::string symbol_string(const reduce_unit<si::electric_potential>::type&) { return "V"; }
0049 
0050 inline std::string name_string(const reduce_unit<si::energy>::type&) { return "joule"; }
0051 inline std::string symbol_string(const reduce_unit<si::energy>::type&) { return "J"; }
0052 
0053 inline std::string name_string(const reduce_unit<si::force>::type&) { return "newton"; }
0054 inline std::string symbol_string(const reduce_unit<si::force>::type&) { return "N"; }
0055 
0056 inline std::string name_string(const reduce_unit<si::frequency>::type&) { return "hertz"; }
0057 inline std::string symbol_string(const reduce_unit<si::frequency>::type&) { return "Hz"; }
0058 
0059 inline std::string name_string(const reduce_unit<si::illuminance>::type&) { return "lux"; }
0060 inline std::string symbol_string(const reduce_unit<si::illuminance>::type&) { return "lx"; }
0061 
0062 inline std::string name_string(const reduce_unit<si::inductance>::type&) { return "henry"; }
0063 inline std::string symbol_string(const reduce_unit<si::inductance>::type&) { return "H"; }
0064 
0065 inline std::string name_string(const reduce_unit<si::luminous_flux>::type&) { return "lumen"; }
0066 inline std::string symbol_string(const reduce_unit<si::luminous_flux>::type&) { return "lm"; }
0067 
0068 inline std::string name_string(const reduce_unit<si::magnetic_flux>::type&) { return "weber"; }
0069 inline std::string symbol_string(const reduce_unit<si::magnetic_flux>::type&) { return "Wb"; }
0070 
0071 inline std::string name_string(const reduce_unit<si::magnetic_flux_density>::type&) { return "tesla"; }
0072 inline std::string symbol_string(const reduce_unit<si::magnetic_flux_density>::type&) { return "T"; }
0073 
0074 inline std::string name_string(const reduce_unit<si::power>::type&) { return "watt"; }
0075 inline std::string symbol_string(const reduce_unit<si::power>::type&) { return "W"; }
0076 
0077 inline std::string name_string(const reduce_unit<si::pressure>::type&) { return "pascal"; }
0078 inline std::string symbol_string(const reduce_unit<si::pressure>::type&) { return "Pa"; }
0079 
0080 inline std::string name_string(const reduce_unit<si::resistance>::type&) { return "ohm"; }
0081 inline std::string symbol_string(const reduce_unit<si::resistance>::type&) { return "Ohm"; }
0082 
0083 
0084 } // namespace units
0085 
0086 } // namespace boost
0087 
0088 #endif // BOOST_UNITS_SI_IO_HPP