Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

NativeTypeFormats.h

Go to the documentation of this file.
00001 #ifndef Impala_Basis_NativeTypeFormats_h
00002 #define Impala_Basis_NativeTypeFormats_h
00003 
00004 #include "Basis/String.h"
00005 #include "Basis/NativeTypes.h"
00006 
00007 namespace Impala
00008 {
00009 
00010 
00011 template <class Type>
00012 inline String
00013 NativeTypeFormat(Type v)
00014 {
00015     return String("unknown");
00016 }
00017 
00018 // template specializations
00019 
00020 template <>
00021 inline String
00022 NativeTypeFormat<UInt8>(UInt8 v)
00023 {
00024     return String("%u");
00025 }
00026 
00027 template <>
00028 inline String
00029 NativeTypeFormat<UInt16>(UInt16 v)
00030 {
00031     return String("%u");
00032 }
00033 
00034 template <>
00035 inline String
00036 NativeTypeFormat<UInt32>(UInt32 v)
00037 {
00038     return String("%u");
00039 }
00040 
00041 template <>
00042 inline String
00043 NativeTypeFormat<UInt64>(UInt64 v)
00044 {
00045     return String("%llu");
00046 }
00047 
00048 template <>
00049 inline String
00050 NativeTypeFormat<Int8>(Int8 v)
00051 {
00052     return String("%d");
00053 }
00054 
00055 template <>
00056 inline String
00057 NativeTypeFormat<Int16>(Int16 v)
00058 {
00059     return String("%d");
00060 }
00061 
00062 template <>
00063 inline String
00064 NativeTypeFormat<Int32>(Int32 v)
00065 {
00066     return String("%d");
00067 }
00068 
00069 template <>
00070 inline String
00071 NativeTypeFormat<Int64>(Int64 v)
00072 {
00073     return String("%lld");
00074 }
00075 
00076 template <>
00077 inline String
00078 NativeTypeFormat<Real32>(Real32 v)
00079 {
00080     return String("%f");
00081 }
00082 
00083 template <>
00084 inline String
00085 NativeTypeFormat<Real64>(Real64 v)
00086 {
00087     return String("%lf");
00088 }
00089 
00090 } // namespace Impala
00091 
00092 #endif

Generated on Fri Mar 19 09:30:42 2010 for ImpalaSrc by  doxygen 1.5.1