181 |
|
* @template ContainerType |
182 |
|
* @template ElemDataType |
183 |
|
*/ |
184 |
< |
template <template<typename ELEM, typename = std::allocator<ELEM> > class ContainerType, |
185 |
< |
typename ElemDataType > |
186 |
< |
class STLContainerTypeData : public GenericData, public ContainerType<ElemDataType>{ |
184 |
> |
template <typename ElemDataType > |
185 |
> |
class VectorTypeData : public GenericData { |
186 |
|
public: |
187 |
< |
typedef STLContainerTypeData<ContainerType, ElemDataType> SelfType; |
189 |
< |
typedef ContainerType<ElemDataType> STLContainerType; |
187 |
> |
typedef VectorTypeData<ElemDataType> SelfType; |
188 |
|
|
189 |
< |
STLContainerTypeData(const std::string& id) |
190 |
< |
: GenericData(id), ContainerType<ElemDataType> () {} |
189 |
> |
VectorTypeData(const std::string& id) |
190 |
> |
: GenericData(id){} |
191 |
|
|
192 |
< |
STLContainerTypeData(const SelfType& s) : SelfType(s){} |
192 |
> |
VectorTypeData(const SelfType& s) : SelfType(s){} |
193 |
|
|
194 |
|
SelfType& operator =(const SelfType& s){ |
195 |
|
if (this == &s) |
196 |
|
return *this; |
197 |
|
|
198 |
< |
STLContainerType::operator=(s); |
198 |
> |
this->data_ = s.data_; |
199 |
|
return *this; |
200 |
|
} |
201 |
+ |
|
202 |
+ |
private: |
203 |
+ |
std::vector<ElemDataType> data_; |
204 |
|
}; |
205 |
|
|
206 |
|
/** |
207 |
|
* @typedef IntVectorGenericData |
208 |
|
* A generic data type contains a std::vector<int> variable. |
209 |
|
*/ |
210 |
< |
typedef STLContainerTypeData<std::vector, int> IntVectorGenericData; |
210 |
> |
typedef VectorTypeData<int> IntVectorGenericData; |
211 |
|
|
212 |
|
/** |
213 |
|
* @typedef IntVectorGenericData |
214 |
|
* A generic data type contains a std::vector<float> variable. |
215 |
|
*/ |
216 |
< |
typedef STLContainerTypeData<std::vector, float> FloatVectorGenericData; |
216 |
> |
typedef VectorTypeData<float> FloatVectorGenericData; |
217 |
|
|
218 |
|
/** |
219 |
|
* @typedef IntVectorGenericData |
220 |
|
* A generic data type contains a std::vector<double> variable. |
221 |
|
*/ |
222 |
< |
typedef STLContainerTypeData<std::vector, double> DoubleVectorGenericData; |
222 |
> |
typedef VectorTypeData<double> DoubleVectorGenericData; |
223 |
|
|
224 |
|
/** |
225 |
|
* @typedef StringVectorGenericData |
249 |
|
* } |
250 |
|
* @endcode |
251 |
|
*/ |
252 |
< |
typedef STLContainerTypeData<std::vector, std::string> StringVectorGenericData; |
252 |
< |
|
253 |
< |
/** |
254 |
< |
* @typedef IntVectorGenericData |
255 |
< |
* A generic data type contains a std::list<vector<string> > variable. |
256 |
< |
*/ |
257 |
< |
typedef STLContainerTypeData<std::list, std::vector<int> > IntVectorListGenericData; |
252 |
> |
typedef VectorTypeData<std::string> StringVectorGenericData; |
253 |
|
|
259 |
– |
#define CHIVALUE_ID "CHIVALUE" |
260 |
– |
#define INTEGRALOFCHIDT_ID "INTEGRALOFCHIDT" |
261 |
– |
#define ETAVALUE_ID "ETAVALUE" |
254 |
|
|
255 |
|
} // namespace oopse |
256 |
|
#endif //UTIL _GENERICDATA_HPP |