im com
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Christian Zimmermann 2024-01-31 19:09:04 +01:00
parent df228d545b
commit e2e233b931
3 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,18 @@
#ifndef __cxz_h5_dataset_cc_h__
#define __cxz_h5_dataset_cc_h__
namespace CNORXZ
{
namespace hdf5
{
template <typename T>
Dataset& Dataset::init(const ArrayBase<T>& data)
{
// !!!!
}
}
}
#endif

View file

@ -27,6 +27,9 @@ namespace CNORXZ
Dataset& init(const RangePtr& dataRange, hid_t type); Dataset& init(const RangePtr& dataRange, hid_t type);
template <typename T>
Dataset& init(const ArrayBase<T>& data);
const RangePtr& dataRange() const; const RangePtr& dataRange() const;
protected: protected:

View file

@ -81,11 +81,16 @@ namespace CNORXZ
Dataset& Dataset::init(const RangePtr& dataRange, hid_t type) Dataset& Dataset::init(const RangePtr& dataRange, hid_t type)
{ {
// check if type is valid type!!! CXZ_ASSERT(not open(), "tried to initialize dataset that is already extisting");
const H5T_class_t tc = H5Tget_class(type);
CXZ_ASSERT(tc != H5T_NO_CLASS, "id does not correspond to a data type"); // (did not found anythng better to check if type id is valid)...
const hid_t dcpl_id = H5Pcreate(H5P_DATASET_CREATE); const hid_t dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
// TODO: all sub-ranges explicity!!!: // TODO: all sub-ranges explicity!!!:
const SizeT ndim = dataRange->dim(); const SizeT ndim = dataRange->dim();
Vector<hsize_t> exts(ndim); Vector<hsize_t> exts(ndim);
for(SizeT i = 0; i != ndim; ++i){
exts[i] = static_cast<hsize_t>( dataRange->sub(i)->size() );
}
mFilespace = H5Screate_simple(ndim, exts.data(), NULL); mFilespace = H5Screate_simple(ndim, exts.data(), NULL);
mType = type; mType = type;
mId = H5Dcreate(mParent->id(), mName.c_str(), mType, mFilespace, mId = H5Dcreate(mParent->id(), mName.c_str(), mType, mFilespace,