Esempio n. 1
0
 /// \brief Open a group if possible, otherwise create a new one
 HDF5Group(const HDF5File &file, const std::string &groupname)
     : HDF5ID<HDF5Group>(-1)
 {
     if (!file) {
         return;
     }
     bool print_error = hdf5_error_printing(false);
     id_ = ::H5Gopen2(file.id(), groupname.c_str(), H5P_DEFAULT);
     hdf5_error_printing(print_error);
     if (!good()) {
         id_ = ::H5Gcreate2(file.id(), groupname.c_str(), H5P_DEFAULT,
             H5P_DEFAULT, H5P_DEFAULT);
     }
 }
Esempio n. 2
0
 HDF5DataSet(const HDF5File &file, const std::string &name,
     const HDF5DataType &type, const HDF5DataSpace &space)
     : HDF5ID<HDF5DataSet>(::H5Dcreate2(file.id(), name.c_str(), type.id(),
           space.id(), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))
 {
 }
Esempio n. 3
0
 HDF5DataSet(const HDF5File &file, const std::string &name)
     : HDF5ID<HDF5DataSet>(::H5Dopen2(file.id(), name.c_str(), H5P_DEFAULT))
 {
 }
Esempio n. 4
0
 HDF5Attribute(const HDF5File &file, const std::string &name)
     : HDF5ID<HDF5Attribute>(
           ::H5Aopen(file.id(), name.c_str(), H5P_DEFAULT))
 {
 }
Esempio n. 5
0
 bool commit(const HDF5File &file, const std::string &name) const
 {
     return ::H5Tcommit2(file.id(), name.c_str(), id_, H5P_DEFAULT,
         H5P_DEFAULT, H5P_DEFAULT);
 }