#include <dimension.hpp>
Inheritance diagram for physical::format::Dimension:
Public Types | |
typedef physical::detail::DynamicExponents< SI > | exponents_type |
Public Member Functions | |
Dimension (std::string name, const exponents_type &e) | |
template<typename T, class Exponents> | |
Dimension (std::string name, const FixedPhysical< SI, T, Exponents > &) | |
template<class Quantity> | |
Dimension (std::string name, const type2type< Quantity > &) | |
Dimension (std::string name, const DynamicPhysical< SI > &q) | |
std::string | name () const |
exponents_type | exponents () const |
Dimension & | add (const FormatSpec< SI > &s) |
FormatSpec< SI > | favourite () const |
FormatSpec< SI > | get (std::size_t i) const |
Private Attributes | |
exponents_type | exponents_ |
std::string | dimensionname |
std::vector< FormatSpec< SI > > | specs |
Definition at line 36 of file dimension.hpp.
Definition at line 38 of file dimension.hpp.
physical::format::Dimension::Dimension | ( | std::string | name, | |
const exponents_type & | e | |||
) | [inline] |
physical::format::Dimension::Dimension | ( | std::string | name, | |
const FixedPhysical< SI, T, Exponents > & | ||||
) | [inline] |
Definition at line 57 of file dimension.hpp.
00058 : dimensionname(name), exponents_(Exponents()) {};
physical::format::Dimension::Dimension | ( | std::string | name, | |
const type2type< Quantity > & | ||||
) | [inline] |
Definition at line 65 of file dimension.hpp.
00066 : dimensionname(name), exponents_(typename Quantity::exponents()) {};
physical::format::Dimension::Dimension | ( | std::string | name, | |
const DynamicPhysical< SI > & | q | |||
) | [inline] |
Definition at line 68 of file dimension.hpp.
00069 : dimensionname(name), exponents_(q.exponents) {};
std::string physical::format::Dimension::name | ( | ) | const [inline] |
Definition at line 73 of file dimension.hpp.
References dimensionname.
00073 {return dimensionname;};
exponents_type physical::format::Dimension::exponents | ( | ) | const [inline] |
Definition at line 76 of file dimension.hpp.
References exponents_.
Referenced by add().
00076 { return exponents_;};
Dimension& physical::format::Dimension::add | ( | const FormatSpec< SI > & | s | ) | [inline] |
Definition at line 78 of file dimension.hpp.
References exponents(), physical::unitsymbol_si_float::s, and specs.
00078 { 00079 if ( s.unit.exponents == exponents()) { 00080 specs.push_back(s); 00081 } else { 00082 throw IncompatibleUnitException("addition of incompatible formatspec"); 00083 }; 00084 return *this; 00085 };
FormatSpec<SI> physical::format::Dimension::favourite | ( | ) | const [inline] |
FormatSpec<SI> physical::format::Dimension::get | ( | std::size_t | i | ) | const [inline] |
Definition at line 97 of file dimension.hpp.
References specs.
Referenced by BOOST_AUTO_UNIT_TEST().
00097 { 00098 if ( 0<=i && i<specs.size() ) { 00099 return specs[0]; 00100 } else { 00101 throw std::range_error("Dimension: cannot find spec"); 00102 }; 00103 }
std::string physical::format::Dimension::dimensionname [private] |
std::vector<FormatSpec<SI> > physical::format::Dimension::specs [private] |
Generated on Mon Apr 2 22:25:08 2007 for physical_svn by 1.5.1-p1 | hosted on |