Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/derived_dimension.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_DERIVED_DIMENSION_HPP
0012 #define BOOST_UNITS_DERIVED_DIMENSION_HPP
0013 
0014 #include <boost/units/dim.hpp>
0015 #include <boost/units/dimension.hpp>
0016 #include <boost/units/static_rational.hpp>
0017 #include <boost/units/units_fwd.hpp>
0018 #include <boost/units/detail/dimension_list.hpp>
0019 
0020 namespace boost {
0021 
0022 namespace units {
0023 
0024 /// A utility class for defining composite dimensions with integer powers.
0025 template<class DT1 = dimensionless_type,long E1 = 0,
0026          class DT2 = dimensionless_type,long E2 = 0,
0027          class DT3 = dimensionless_type,long E3 = 0,
0028          class DT4 = dimensionless_type,long E4 = 0,
0029          class DT5 = dimensionless_type,long E5 = 0,
0030          class DT6 = dimensionless_type,long E6 = 0,
0031          class DT7 = dimensionless_type,long E7 = 0,
0032          class DT8 = dimensionless_type,long E8 = 0>
0033 struct derived_dimension
0034 {
0035 #ifdef BOOST_UNITS_DOXYGEN
0036     typedef detail::unspecified type;
0037 #else
0038     typedef typename 
0039     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0040                          list< dim< DT2,static_rational<E2> >,
0041                          list< dim< DT3,static_rational<E3> >,
0042                          list< dim< DT4,static_rational<E4> >,
0043                          list< dim< DT5,static_rational<E5> >,
0044                          list< dim< DT6,static_rational<E6> >,
0045                          list< dim< DT7,static_rational<E7> >,
0046                          list< dim< DT8,static_rational<E8> >, dimensionless_type > > > > > > > > >::type type;
0047 #endif
0048 };
0049 
0050 /// INTERNAL ONLY
0051 template<class DT1,long E1>
0052 struct derived_dimension<
0053     DT1, E1,
0054     dimensionless_type,0,
0055     dimensionless_type,0,
0056     dimensionless_type,0,
0057     dimensionless_type,0,
0058     dimensionless_type,0,
0059     dimensionless_type,0,
0060     dimensionless_type,0>
0061 {
0062     typedef typename 
0063     make_dimension_list< list< dim< DT1,static_rational<E1> >, dimensionless_type > >::type type;
0064 };
0065 
0066 /// INTERNAL ONLY
0067 template<class DT1,long E1,
0068          class DT2,long E2>
0069 struct derived_dimension<
0070     DT1, E1,
0071     DT2, E2,
0072     dimensionless_type,0,
0073     dimensionless_type,0,
0074     dimensionless_type,0,
0075     dimensionless_type,0,
0076     dimensionless_type,0,
0077     dimensionless_type,0>
0078 {
0079     typedef typename 
0080     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0081                          list< dim< DT2,static_rational<E2> >, dimensionless_type > > >::type type;
0082 };
0083 
0084 /// INTERNAL ONLY
0085 template<class DT1,long E1,
0086          class DT2,long E2,
0087          class DT3,long E3>
0088 struct derived_dimension<
0089     DT1, E1,
0090     DT2, E2,
0091     DT3, E3,
0092     dimensionless_type,0,
0093     dimensionless_type,0,
0094     dimensionless_type,0,
0095     dimensionless_type,0,
0096     dimensionless_type,0>
0097 {
0098     typedef typename 
0099     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0100                          list< dim< DT2,static_rational<E2> >,
0101                          list< dim< DT3,static_rational<E3> >, dimensionless_type > > > >::type type;
0102 };
0103 
0104 /// INTERNAL ONLY
0105 template<class DT1,long E1,
0106          class DT2,long E2,
0107          class DT3,long E3,
0108          class DT4,long E4>
0109 struct derived_dimension<
0110     DT1, E1,
0111     DT2, E2,
0112     DT3, E3,
0113     DT4, E4,
0114     dimensionless_type,0,
0115     dimensionless_type,0,
0116     dimensionless_type,0,
0117     dimensionless_type,0>
0118 {
0119     typedef typename 
0120     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0121                          list< dim< DT2,static_rational<E2> >,
0122                          list< dim< DT3,static_rational<E3> >,
0123                          list< dim< DT4,static_rational<E4> >, dimensionless_type > > > > >::type type;
0124 };
0125 
0126 /// INTERNAL ONLY
0127 template<class DT1,long E1,
0128          class DT2,long E2,
0129          class DT3,long E3,
0130          class DT4,long E4,
0131          class DT5,long E5>
0132 struct derived_dimension<
0133     DT1, E1,
0134     DT2, E2,
0135     DT3, E3,
0136     DT4, E4,
0137     DT5, E5,
0138     dimensionless_type,0,
0139     dimensionless_type,0,
0140     dimensionless_type,0>
0141 {
0142     typedef typename 
0143     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0144                          list< dim< DT2,static_rational<E2> >,
0145                          list< dim< DT3,static_rational<E3> >,
0146                          list< dim< DT4,static_rational<E4> >,
0147                          list< dim< DT5,static_rational<E5> >, dimensionless_type > > > > > >::type type;
0148 };
0149 
0150 /// INTERNAL ONLY
0151 template<class DT1,long E1,
0152          class DT2,long E2,
0153          class DT3,long E3,
0154          class DT4,long E4,
0155          class DT5,long E5,
0156          class DT6,long E6>
0157 struct derived_dimension<
0158     DT1, E1,
0159     DT2, E2,
0160     DT3, E3,
0161     DT4, E4,
0162     DT5, E5,
0163     DT6, E6,
0164     dimensionless_type,0,
0165     dimensionless_type,0>
0166 {
0167     typedef typename 
0168     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0169                          list< dim< DT2,static_rational<E2> >,
0170                          list< dim< DT3,static_rational<E3> >,
0171                          list< dim< DT4,static_rational<E4> >,
0172                          list< dim< DT5,static_rational<E5> >,
0173                          list< dim< DT6,static_rational<E6> >, dimensionless_type > > > > > > >::type type;
0174 };
0175 
0176 /// INTERNAL ONLY
0177 template<class DT1,long E1,
0178          class DT2,long E2,
0179          class DT3,long E3,
0180          class DT4,long E4,
0181          class DT5,long E5,
0182          class DT6,long E6,
0183          class DT7,long E7>
0184 struct derived_dimension<
0185     DT1, E1,
0186     DT2, E2,
0187     DT3, E3,
0188     DT4, E4,
0189     DT5, E5,
0190     DT6, E6,
0191     DT7, E7,
0192     dimensionless_type,0>
0193 {
0194     typedef typename 
0195     make_dimension_list< list< dim< DT1,static_rational<E1> >,
0196                          list< dim< DT2,static_rational<E2> >,
0197                          list< dim< DT3,static_rational<E3> >,
0198                          list< dim< DT4,static_rational<E4> >,
0199                          list< dim< DT5,static_rational<E5> >,
0200                          list< dim< DT6,static_rational<E6> >,
0201                          list< dim< DT7,static_rational<E7> >, dimensionless_type > > > > > > > >::type type;
0202 };
0203 
0204 } // namespace units
0205 
0206 } // namespace boost                                                                   
0207 
0208 #endif // BOOST_UNITS_DERIVED_DIMENSION_HPP