00001 00002 /*============================================================================= 00003 physical quantities / units / constants 00004 Copyright (c) 2006, 2007 Martin Schulz 00005 http://physical.sourceforge.net 00006 00007 This is private code by Martin Schulz. 00008 00009 Use, modification and distribution is subject to the Boost Software 00010 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 00011 http://www.boost.org/LICENSE_1_0.txt) 00012 =============================================================================*/ 00013 00014 #ifndef PHYSICAL_DYNAMICUNIT_IMPL 00015 #define PHYSICAL_DYNAMICUNIT_IMPL 00016 00017 #include "physical/dynamicunit.hpp" 00018 00019 #include "physical/dynamicphysical.hpp" 00020 00021 00022 namespace physical { 00023 00024 template<class UnitSystem> 00025 DynamicUnit<UnitSystem>::DynamicUnit(const DynamicUnit<UnitSystem>& definition, const detail::DynamicScale scale) 00026 : exponents(definition.exponents) 00027 , scale(definition.scale.factor*scale.factor, 00028 definition.scale.origin + definition.scale.factor*scale.origin) 00029 {}; 00030 00031 // explict conversion from quantities to units 00032 // FIXME: shouldn't we replace this one by the one below 00033 // That would be more explicit, but harder to read most of the time: 00034 // DynamicUnit minute(second, scale(60, 0)); 00035 template<class UnitSystem> 00036 DynamicUnit<UnitSystem>::DynamicUnit(const DynamicPhysical<UnitSystem>& definition) 00037 : exponents(definition.exponents) 00038 , scale(definition.numerical_value) 00039 {}; 00040 00041 // explict conversion from quantities to units 00042 template<class UnitSystem> 00043 DynamicUnit<UnitSystem>::DynamicUnit(const DynamicPhysical<UnitSystem>& definition, const detail::DynamicScale scale) 00044 : exponents(definition.exponents) 00045 , scale(definition.numerical_value*scale.factor, definition.numerical_value*scale.origin) 00046 {}; 00047 00048 }; // namespace physical 00049 00050 #endif // PHYSICAL_DYNAMICUNIT_IMPL
Generated on Mon Apr 2 22:25:03 2007 for physical_svn by 1.5.1-p1 | hosted on |