VoltageScanRate.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2009, Bernd Speiser */
00008 
00009 /* This file is part of Quantities.
00010 
00011 PhysicalQuantities is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 PhysicalQuantities is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020   
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024 02111-1307, USA.
00025 */
00026 
00027 #ifndef _VoltageScanRate_h
00028 #define _VoltageScanRate_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "PhysicalQuantities/ElectricPotential.h"
00034 #include "PhysicalQuantities/Time.h"
00035 
00036 namespace quantity {
00037   namespace voltageScanRate {
00038 
00040 class Class;
00041 
00043 class Unit;
00044 
00045 /* declaration of VoltageScanRate units of type VoltPerSecondUnit */
00046 
00047 typedef LOKI_TYPELIST_4(electricPotential::Volt, 
00048   electricPotential::MilliVolt, electricPotential::KiloVolt, 
00049                     electricPotential::MegaVolt) ElectricPotentialList;
00050 
00052 typedef 
00053   unit::ComposeElement<Unit, ElectricPotentialList, 
00054                     BSUtilities::Rational<1> > ElectricPotentialElement;
00055 
00056 typedef LOKI_TYPELIST_3(time::Second, time::MilliSecond, 
00057                                            time::MicroSecond) TimeList;
00058 
00060 typedef 
00061   unit::ComposeElement<Unit, TimeList, 
00062                                 BSUtilities::Rational<-1> > TimeElement;
00063 
00064 typedef unit::ComposeBase<Unit, 
00065   LOKI_TYPELIST_2(ElectricPotentialElement, TimeElement)> 
00066                                             VoltageScanRateComposedUnit;
00067 
00068 typedef unit::Composed<VoltageScanRateComposedUnit,
00069   LOKI_TYPELIST_2(electricPotential::Volt, time::Second)> VoltPerSecond;
00070 typedef unit::Composed<VoltageScanRateComposedUnit,
00071   LOKI_TYPELIST_2(electricPotential::Volt, time::MilliSecond)> 
00072                                                      VoltPerMilliSecond;
00073 typedef unit::Composed<VoltageScanRateComposedUnit,
00074   LOKI_TYPELIST_2(electricPotential::Volt, time::MicroSecond)> 
00075                                                      VoltPerMicroSecond;
00076 typedef unit::Composed<VoltageScanRateComposedUnit,
00077   LOKI_TYPELIST_2(electricPotential::MilliVolt, time::Second)> 
00078                                                      MilliVoltPerSecond;
00079 typedef unit::Composed<VoltageScanRateComposedUnit,
00080   LOKI_TYPELIST_2(electricPotential::KiloVolt, time::Second)> 
00081                                                      KiloVoltPerSecond;
00082 typedef unit::Composed<VoltageScanRateComposedUnit,
00083   LOKI_TYPELIST_2(electricPotential::MegaVolt, time::Second)> 
00084                                                       MegaVoltPerSecond;
00085 
00087 typedef LOKI_TYPELIST_6(VoltPerSecond, VoltPerMilliSecond, 
00088   VoltPerMicroSecond, MilliVoltPerSecond, KiloVoltPerSecond, 
00089                                                MegaVoltPerSecond) Units;
00090 
00091 /* VoltageScanRate quantity */
00092 
00093 typedef Quantity<Class> Quantity;
00094 
00095 class DerivedVoltageScanRate;
00096 
00097   } // end namespace voltageScanRate
00098 
00100 
00102   template<typename ST>
00103     struct Standard<voltageScanRate::VoltageScanRateComposedUnit, ST>
00104     {
00105       static const ST ratio;
00106       static const bool exact;
00107     };
00108 
00110 template<typename ST> const ST 
00111   Standard<voltageScanRate::VoltageScanRateComposedUnit, ST>::ratio = 1.0;
00112 
00114 template<typename ST> const bool 
00115   Standard<voltageScanRate::VoltageScanRateComposedUnit, ST>::exact = true;
00116 
00118 template<>
00119   struct QuantityTraits<voltageScanRate::Class>
00120   {
00121     typedef
00122       dimension::Dimension<BSUtilities::Rational<2>,
00123         BSUtilities::Rational<1>, BSUtilities::Rational<-4>,
00124           BSUtilities::Rational<-1>, BSUtilities::Rational<0>,
00125             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00126     typedef voltageScanRate::Unit UnitType;
00127     typedef voltageScanRate::Units UnitList;
00128     typedef voltageScanRate::VoltPerSecond DefaultUnit;
00129 
00130     typedef voltageScanRate::DerivedVoltageScanRate DefaultDerivedQuantityType;
00131 
00132     static const std::string NameString;
00133     static const std::string SymbolString;
00134 
00135   };
00136 
00137 // the derived quantity traits template for VoltPerSecond VoltageScanRate
00138 template<>
00139   struct DerivedQuantityTraits<voltageScanRate::Class, voltageScanRate::DerivedVoltageScanRate>
00140   {
00141     static const bool OverwriteName = false;
00142     static const bool OverwriteSymbol = false;
00143 
00144     static const std::string NameString;
00145     static const std::string SymbolString;
00146 
00147   };
00148 
00150 typedef Variable<voltageScanRate::Quantity> VoltageScanRate;
00151 
00153 typedef Constant<voltageScanRate::Quantity> VoltageScanRateConstant;
00154 
00156 typedef QuantityVector<Variable, voltageScanRate::Quantity> VoltageScanRateVector;
00157 
00158 } // end namespace quantity
00159 
00160 #endif /* _VoltageScanRate_h */

Generated on Mon Jul 27 15:55:45 2009 for Quantities by  doxygen 1.5.3