7 fname_(fname), double_data_(), int_data_() {}
10 const vector<double>& data_set)
12 double_data_.push_back(pair<
string,vector<double> >
13 (field_name,data_set));
18 const vector<int>& data_set)
20 int_data_.push_back(pair<
string,vector<int> >
21 (field_name,data_set));
27 const vector<double>& data,
28 const string& caption)
30 FloatType datatype(PredType::NATIVE_DOUBLE);
31 datatype.setOrder(H5T_ORDER_LE);
41 const vector<int>& data,
42 const string& caption)
44 IntType datatype(PredType::NATIVE_INT);
45 datatype.setOrder(H5T_ORDER_LE);
55 H5File file(H5std_string(fname_), H5F_ACC_TRUNC);
56 for(
size_t i=0;i<double_data_.size();++i)
58 for(
size_t i=0;i<int_data_.size();++i)
Various useful functions.
Facilitates writing hdf5 files.
void write_std_vector_to_hdf5(const Group &file, const vector< T > &data, const string &caption, const DataType &dt)
Master function for writing vectors to hdf5 files.
~HDF5Shortcut(void)
Class destructor. This is the stage when the file is written.
Higher level hdf5 utilities.
HDF5Shortcut(const string &fname)
Class constructor.
HDF5Shortcut & operator()(const string &field_name, const vector< double > &data_set)
adds dataset