00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _Intermediate_h
00025 #define _Intermediate_h
00026
00027 #include "Quantity/Variable.h"
00028 #include "Quantity/Generic.h"
00029
00030 namespace Quantities {
00031
00033
00034
00035
00037
00039 template<class GT, class ST = double>
00040 class IntermediateQuantity
00041 : public Variable<Quantity<GenericClass<GT>,
00042 Loki::Typelist<Units::NonPrefixable<GenericClass<GT>,
00043 Units::GenericUnit, ST>, Loki::NullType>,
00044 Units::NonPrefixable<GenericClass<GT>, Units::GenericUnit, ST>,
00045 ST>, Units::NonPrefixable<GenericClass<GT>,
00046 Units::GenericUnit, ST> >
00047 {
00048 private:
00049 IntermediateQuantity () {}
00050
00051 typedef Variable<Quantity<GenericClass<GT>,
00052 Loki::Typelist<Units::NonPrefixable<GenericClass<GT>,
00053 Units::GenericUnit, ST>, Loki::NullType>,
00054 Units::NonPrefixable<GenericClass<GT>, Units::GenericUnit,
00055 ST>, ST>,
00056 Units::NonPrefixable<GenericClass<GT>, Units::GenericUnit,
00057 ST> > V;
00058
00059 class GeneralStore {};
00060
00061 template <template<class, class> class Q1, class GT1,
00062 class Head1, class Tail1, class DU1, class U1>
00063 class Store : public GeneralStore
00064 {
00065 private:
00066 typedef
00067 Q1<Quantity<GT1, Loki::Typelist<Head1, Tail1>, DU1, ST>,
00068 U1> Q;
00069 Q stored;
00070
00071 Store () {}
00072
00073 public:
00074 Store (const Q &source) : stored (source) {}
00075 };
00076
00077 GeneralStore *store;
00078
00079 public:
00080 IntermediateQuantity (IntermediateQuantity &intermediate) {}
00081
00082
00083 template <template<class, class> class Q1, class GT1,
00084 class Head1, class Tail1, class DU1, class U1>
00085 IntermediateQuantity
00086 (const
00087 Q1<Quantity<GT1, Loki::Typelist<Head1, Tail1>, DU1, ST>, U1>
00088 &quantity)
00089 {
00090 store = new Store<Q1, GT1, Head1, Tail1, DU1, U1> (quantity);
00091 }
00092 };
00093
00094
00096
00098 typedef IntermediateQuantity<double> Intermediate;
00100
00102 typedef IntermediateQuantity<int> IntIntermediate;
00103 }
00104
00105 #endif