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
00022
00023
00024
00025
00026
00027
00034 #ifndef KEYVALUE_KEY_MAP_NOMAP_H_
00035 #define KEYVALUE_KEY_MAP_NOMAP_H_
00036
00037 #include <boost/static_assert.hpp>
00038 #include <boost/type_traits/is_same.hpp>
00039
00040 #include "keyvalue/extern/String.h"
00041 #include "keyvalue/extern/Ptime.h"
00042 #include "keyvalue/key/Key.h"
00043
00044 namespace keyvalue {
00045
00046
00047
00048 namespace value {
00049 class Variant;
00050 }
00051
00052 namespace key {
00053
00071 template <typename OutputType>
00072 class NoMap {
00073
00074 public:
00075
00076 typedef OutputType OutputType_;
00077
00089 OutputType
00090 map(const value::Variant& variant) const;
00091
00092 private:
00093
00099 virtual string
00100 getName() const = 0;
00101
00102 typedef typename boost::is_same<OutputType, bool >::type IsBool_;
00103 typedef typename boost::is_same<OutputType, double>::type IsDouble_;
00104 typedef typename boost::is_same<OutputType, ptime >::type IsPtime_;
00105 typedef typename boost::is_same<OutputType, string>::type IsString_;
00106 typedef typename boost::is_same<OutputType, unsigned int>::type IsUInt_;
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 BOOST_STATIC_ASSERT(IsBool_::value || IsDouble_::value ||
00117 IsString_::value || IsPtime_::value || IsUInt_::value);
00118
00119 };
00120
00121 }
00122 }
00123
00124 #endif // KEYVALUE_KEY_MAP_NOMAP_H_