00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _Generic_h
00025 #define _Generic_h
00026
00027 #include "Quantity/Unit.h"
00028 #include "Quantity/Quantity.h"
00029
00030 namespace quantity {
00031
00032
00033
00035
00040 template<class DIM> struct GenericClass {};
00041
00042 }
00043
00044 namespace unit {
00045
00047 class GenericUnit;
00048
00050
00051
00052
00054
00056
00062 template<class DIM>
00063 class NonPrefixable<quantity::GenericClass<DIM>, GenericUnit>
00064 : public Unit<quantity::GenericClass<DIM> >
00065 {
00066 public:
00067 static const bool IsSI;
00068
00069 const bool isSI (void) const {return IsSI ();}
00070
00071 static const std::string Namestring;
00072
00073 static std::string Name (void) {return Namestring;}
00074
00075 const std::string name (void) const {return Name ();}
00076
00077 static const std::string Symbolstring;
00078
00079 static std::string Symbol (void) {return Symbolstring;}
00080
00081 const std::string symbol (void) const {return Symbol ();}
00082 };
00083
00084 template<class DIM> const bool
00085 NonPrefixable<quantity::GenericClass<DIM>, GenericUnit>::IsSI
00086 = false;
00087
00088 template<class DIM> const
00089 std::string
00090 NonPrefixable<quantity::GenericClass<DIM>, GenericUnit>
00091 ::Namestring = "";
00092
00093 template<class DIM> const
00094 std::string
00095 NonPrefixable<quantity::GenericClass<DIM>, GenericUnit>
00096 ::Symbolstring = "(unknown unit)";
00097 }
00098
00099 namespace quantity {
00100
00102
00103
00104
00106
00108 template<class DIM, class UL, class DU, class ST>
00109 struct Name<Quantity<DIM, GenericClass<DIM>, UL, DU, ST> >
00110 {
00112 static const std::string String;
00113 };
00114
00115 template<class DIM, class UL, class DU, class ST>
00116 const std::string
00117 Name<Quantity<DIM, GenericClass<DIM>, UL, DU, ST> >::String = "";
00118
00120 template<class DIM, class UL, class DU, class ST>
00121 struct Symbol<Quantity<DIM, GenericClass<DIM>, UL, DU, ST> >
00122 {
00124 static const std::string String;
00125 };
00126
00128 template<class DIM, class UL, class DU, class ST>
00129 const std::string
00130 Symbol<Quantity<DIM, GenericClass<DIM>, UL, DU, ST> >::String = "";
00131
00133 template<class DIM, class ST>
00134 struct Standard<unit::NonPrefixable<GenericClass<DIM>,
00135 unit::GenericUnit>, ST>
00136 {
00137 static const ST ratio;
00138 static const bool exact;
00139 };
00140
00142 template<class DIM, class ST>
00143 const ST
00144 Standard<unit::NonPrefixable<GenericClass<DIM>,
00145 unit::GenericUnit>, ST>::ratio = ST(1.0);
00146
00148 template<class DIM, class ST>
00149 const bool
00150 Standard<unit::NonPrefixable<GenericClass<DIM>,
00151 unit::GenericUnit>, ST>::exact = true;
00152
00153 }
00154
00155 #endif