NoMap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #ifndef KEYVALUE_KEY_MAP_NOMAP_H_
00029 #define KEYVALUE_KEY_MAP_NOMAP_H_
00030
00031 #include <boost/static_assert.hpp>
00032 #include <boost/type_traits/is_same.hpp>
00033
00034 #include "keyvalue/extern/String.h"
00035 #include "keyvalue/extern/Ptime.h"
00036 #include "keyvalue/key/Key.h"
00037
00038 namespace keyvalue {
00039
00040
00041
00042 namespace value {
00043 class Variant;
00044 }
00045
00046 namespace key {
00047
00065 template <typename OutputType>
00066 class NoMap {
00067
00068 public:
00069
00070 typedef OutputType OutputType_;
00071
00072 NoMap();
00073
00085 OutputType
00086 map(const value::Variant& variant) const;
00087
00088 private:
00089
00095 virtual string
00096 getName() const = 0;
00097
00098 typedef typename boost::is_same<OutputType, bool >::type IsBool_;
00099 typedef typename boost::is_same<OutputType, double>::type IsDouble_;
00100 typedef typename boost::is_same<OutputType, ptime >::type IsPtime_;
00101 typedef typename boost::is_same<OutputType, string>::type IsString_;
00102 typedef typename boost::is_same<OutputType, unsigned int>::type IsUInt_;
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 BOOST_STATIC_ASSERT(IsBool_::value || IsDouble_::value ||
00113 IsString_::value || IsPtime_::value || IsUInt_::value);
00114
00115 };
00116
00117 }
00118 }
00119
00120 #endif // KEYVALUE_KEY_MAP_NOMAP_H_