physical::format::Dimension Class Reference

#include <dimension.hpp>

Inheritance diagram for physical::format::Dimension:

Inheritance graph
[legend]
Collaboration diagram for physical::format::Dimension:

Collaboration graph
[legend]
List of all members.

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
Dimensionadd (const FormatSpec< SI > &s)
FormatSpec< SIfavourite () const
FormatSpec< SIget (std::size_t i) const

Private Attributes

exponents_type exponents_
std::string dimensionname
std::vector< FormatSpec< SI > > specs

Detailed Description

Definition at line 36 of file dimension.hpp.


Member Typedef Documentation

typedef physical::detail::DynamicExponents<SI> physical::format::Dimension::exponents_type

Definition at line 38 of file dimension.hpp.


Constructor & Destructor Documentation

physical::format::Dimension::Dimension ( std::string  name,
const exponents_type e 
) [inline]

Definition at line 40 of file dimension.hpp.

00041                                 : dimensionname(name), exponents_(e) {};

template<typename T, class Exponents>
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()) {};

template<class Quantity>
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) {};


Member Function Documentation

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]

Definition at line 92 of file dimension.hpp.

References specs.

00092 {return specs[0];};

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                         }


Member Data Documentation

exponents_type physical::format::Dimension::exponents_ [private]

Definition at line 109 of file dimension.hpp.

Referenced by exponents().

std::string physical::format::Dimension::dimensionname [private]

Definition at line 112 of file dimension.hpp.

Referenced by name().

std::vector<FormatSpec<SI> > physical::format::Dimension::specs [private]

Definition at line 114 of file dimension.hpp.

Referenced by add(), favourite(), and get().


The documentation for this class was generated from the following file:
Generated on Mon Apr 2 22:25:08 2007 for physical_svn by  doxygen 1.5.1-p1
hosted on SourceForge.net Logo