66 |
|
template<typename T> static bool convert(T v, RepType& r){return false;} // !NB everything is ok |
67 |
|
template<typename T> static RepType convert(T v) {RepType tmp; convert(v,tmp);return tmp;} |
68 |
|
static bool convert(RepType v, RepType& r) { r = v; return true;} |
69 |
+ |
static char* getParamType() { return "std::string";} |
70 |
|
}; |
71 |
|
//bool |
72 |
|
template<> |
87 |
|
|
88 |
|
return result; |
89 |
|
} |
90 |
+ |
static char* getParamType() { return "bool";} |
91 |
|
}; |
92 |
|
|
93 |
|
//int |
97 |
|
template<typename T> static bool convert(T, RepType&){return false;} |
98 |
|
template<typename T> static RepType convert(T v) {RepType tmp; convert(v,tmp);return tmp;} |
99 |
|
static bool convert(RepType v, RepType& r) { r=v; return true;} |
100 |
+ |
static char* getParamType() { return "int";} |
101 |
|
}; |
102 |
|
|
103 |
|
//double |
108 |
|
template<typename T> static RepType convert(T v) {RepType tmp; convert(v,tmp);return tmp;} |
109 |
|
static bool convert(RepType v, RepType& r) {r=v; return true;} |
110 |
|
static bool convert(int v, RepType& r) {r = static_cast<double>(v); return true;} |
111 |
+ |
static char* getParamType() { return "double";} |
112 |
|
}; |
113 |
|
|
114 |
|
|
125 |
|
virtual bool setData(std::string) = 0; |
126 |
|
virtual bool setData(int) = 0; |
127 |
|
virtual bool setData(double) = 0; |
128 |
< |
|
128 |
> |
virtual char* getParamType() = 0; |
129 |
|
protected: |
130 |
|
std::string keyword_; |
131 |
|
bool optional_; |
143 |
|
virtual bool setData(std::string sval) { |
144 |
|
return internalSetData<std::string>(sval); |
145 |
|
} |
146 |
< |
virtual bool setData(int ial) { |
147 |
< |
return internalSetData<int>(ial); |
146 |
> |
virtual bool setData(int ival) { |
147 |
> |
return internalSetData<int>(ival); |
148 |
|
} |
149 |
|
|
150 |
|
virtual bool setData(double dval) { |
151 |
|
return internalSetData<double>(dval); |
152 |
|
} |
153 |
|
|
154 |
+ |
virtual char* getParamType() { return ParameterTraits<ParamType>::getParamType();} |
155 |
|
private: |
156 |
|
template<class T> bool internalSetData(T data) { |
157 |
|
ParamType tmp; |