一.数据容器的定义:
DataContainer.h:
#ifndef DATA_CONTAINER_H
#define DATA_CONTAINER_H
#include <vector>
#include <Poco/Any.h>
class DataContainer{
public:
void push(Poco::Any any);
Poco::Any get(int index);
size_t size();
private:
std::vector<Poco::Any> _vector;
};
inline void DataContainer::push(Poco::Any any){
_vector.push_back(any);
}
inline Poco::Any DataContainer::get(int index){
if(index < size()){
return _vector[index];
}else{
return 0;
}
}
inline size_t DataContainer::size(){
return _vector.size();