boost::shared_ptr<HDFDataSet<HDFImpl> > writeDataset(const std::string & path, const Type* data, const Slab<order, HDFImpl> &memslab, const Slab<order, HDFImpl> &fileslab) { boost::shared_ptr<HDFDataSet<HDFImpl> > dataset; try { dataset = createDataset<Type>(path, fileslab); } catch (DatasetExists &) { dataset = openDataset(path); } dataset->writeData(data, memslab); return dataset; }
boost::shared_ptr<HDFDataSet<HDFImpl> > writeDataset(const std::string & path, const std::vector<Type> & data) { std::vector<hsize_t> dims(1,data.size()); boost::shared_ptr<HDFDataSet<HDFImpl> > dataset; try { dataset = createDataset<Type,1>(path, dims); } catch (DatasetExists &) { dataset = openDataset(path); } dataset->writeData(data); return dataset; }
QH5Dataset :: QH5Dataset (QH5File *file, QH5Dataspace *dataspace, QString const &path, QH5Datatype::Type dtype, QObject *parent) : QObject (parent) , datasetId (openDataset (file, dataspace, path, dtype)) , datatype(dtype) {}