Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef BINDTYPES_H_
00009 #define BINDTYPES_H_
00010
00011 #include "PqTypeWrap.h"
00012
00013 namespace psql
00014 {
00015
00016 template<typename... Args>
00017 class BindTypes
00018 {
00019 };
00020
00021 template<typename Head, typename... Tail>
00022 class BindTypes<Head, Tail...> : private BindTypes<Tail...>
00023 {
00024 private:
00025 PqTypeWrap<Head> tw;
00026 protected:
00027 void put_prot(PGparam* param, Head h, Tail... t)
00028 {
00029 tw.put(param, h);
00030 BindTypes<Tail...>::put_prot(param, t...);
00031 }
00032 public:
00033 void put(PGparam* param, Head h, Tail... t)
00034 {
00035 PQparamReset(param);
00036 put_prot(param, h, t...);
00037 }
00038 };
00039
00040 template<>
00041 class BindTypes<>
00042 {
00043 protected:
00044 void put_prot(PGparam*)
00045 {
00046 }
00047 public:
00048 void put(PGparam* param)
00049 {
00050 PQparamReset(param);
00051 }
00052 };
00053
00054 }
00055 #endif