Implementation

Here, we describe implementation details of the PhysicalQuantities part of the Quantities package. The description is meant to be mainly textual. Additional information with direct reference to the code is included into the detailed documentation of classes, functions, and variables

The current version was implemented with the GNU C++ compiler, gcc, up to version 4.3.0. Some older compiler versions, notably those from the 3.3.x series will fail to compile the code.

PhysicalQuantitiese provides header files (*.h) and implementation files (*.cc) for each physical quantity. Moreover to allow serialization, export code is given in files *_export.h. The headers and expot files should be included into user code as appropriate. If the conversion between temperature values in different scales is attempted, also header TemperatureConversions.h must be included.

Physical quantities are implemented as template specializations of Quantity<> derived Variable<>, Constant<> or UniqueConstant<> types. In particular, the quantity type is specified, and for each quantity type a QuantityTraits<> traits template is provided. In this template, the Dimension, the UnitType, the UnitList, and the DefaultUnit of the physical quantity are specified.

Fundamental physical constants are implemented as UniqueConstants. Some of them are additionally defined physical quantities with a separate quantity type (e.g., FaradayConstant), others, however, are just UniqueConstants derived from an already existing Quantity<> (e.g., ElementaryCharge is a UniqueConstant using the electricCharge::Quantity base class.

References

back to Physical Quantities start page
Generated on Mon Jul 27 15:55:46 2009 for Quantities by  doxygen 1.5.3