#ifndef __cxz_h5_table_cc_h__ #define __cxz_h5_table_cc_h__ #include "h5_table.h" #include "h5_types.h" namespace CNORXZ { namespace hdf5 { template decltype(auto) iterRecords(F&& f) const { } template STabel::STabel(const String& name, const ContentBase* _parent, const RangePtr& fields) : Table(name, _parent) { constexpr SizeT N = sizeof...(Ts); if(mFields == nullptr){ CXZ_ASSERT(fields != nullptr, "field names have to be initialized"); mFields = fields; } CXZ_ASSERT(mFields->size() == sizeof...(Ts), "expected tuple of size = " << mFields->size() << ", got: " << sizeof...(Ts)); if(mRecords == nullptr) { auto mOffsets = MArray( mFields, iter<0,N> ( [&](auto i) { return &std::get(t) - &t; }, [](const auto&... e) { return Vector({e...}); }) ); auto mSizes = MArray( mFields, iter<0,N> ( [&](auto i) { return sizeof(std::get(t)); }, [](const auto&... e) { return Vector({e...}); }) ); auto mTypes = MArray( mFields, iter<0,N> ( [&](auto i) { return getTypeId(std::get(t)); }, [](const auto&... e) { return Vector({e...}); }) ); } else { iter<0,N>( [&](auto i) { CXZ_ASSERT ( &std::get(t) - &t == mOffsets.data()[i], "wrong offset for field " << i << ": " << &std::get(t) - &t << " vs " << mOffsets.data()[i] ); }, NoF{} ); iter<0,N>( [&](auto i) { CXZ_ASSERT ( sizeof(std::get(t)) == mSizes.data()[i], "wrong size for field " << i << ": " << sizeof(std::get(t)) << " vs " << mSizes.data()[i] ); }, NoF{} ); iter<0,N>( [&](auto i) { CXZ_ASSERT ( getTypeId(std::get(t)) == mTypes.data()[i], "wrong type for field " << i << ": " << getTypeId(std::get(t)) << " vs " << mTypes.data()[i] ); }, NoF{} ); } } template STabel& STabel::appendRecord(const Tuple& t) { RangePtr appr = CRangeFactory(1).create(); if(mRecords == nullptr){ mRecords = appr; } else { mRecords = mRecords->extend(appr); } H5TBappend_records(mParent->id(), mName, 1, sizeof(t), mOffsets.data(), mSizes.data(), &t); return *this; } } } #endif