我有一个需要将数据存储到 hdf 文件的应用程序。
是否可以将数据集存储在实际上是 C++ 对象的 hdf 中?例如,我想将a
下面对象中包含的数据存储到 hdf 文件 (hdf4 或 hdf5) 。我可以这样做吗?如果是的话,如果有人能做到这一点,我将不胜感激。谢谢你。
class A(){
public:
A(int i, double j):i(i), j(j){};
~A();
int i;
double j;
int* ai;
vector<int> b;
setValues(int i, double j){};
}
void main(){
A *a;
a = new A(10, 10.2);
// Store this data to hdf4 or hdf5
//
A *a2;
// now read in the data stored in hdf file and assign the value here
}