ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
ritsuko::hdf5::ReclaimVlsMemory< DataTypePointer_, DataSpacePointer_, DSetMemXferPropListPointer_ > Class Template Reference

Reclaim memory for HDF5's variable length strings. More...

#include <ReclaimVlsMemory.hpp>

Public Member Functions

 ReclaimVlsMemory (DataTypePointer_ type_ptr, DataSpacePointer_ space_ptr, DSetMemXferPropListPointer_ plist_ptr, char **buffer)
 

Detailed Description

template<class DataTypePointer_ = H5::DataType*, class DataSpacePointer_ = H5::DataSpace*, class DSetMemXferPropListPointer_ = H5::DSetMemXferPropList*>
class ritsuko::hdf5::ReclaimVlsMemory< DataTypePointer_, DataSpacePointer_, DSetMemXferPropListPointer_ >

Reclaim memory for HDF5's variable length strings.

Template Parameters
DataTypePointer_Class of a pointer to a H5::DataType. This can be raw or smart depending on the caller's management of its lifetime.
DataSpacePointer_Class of a pointer to a H5::DataSpace. This can be raw or smart depending on the caller's management of its lifetime.
DSetMemXferPropListPointer_Class of a pointer to a H5::DSetMemXferPropList. This can be raw or smart depending on the caller's management of its lifetime.

This provides an RAII interface for HDF5's variable length strings. The idea is to create an instance of this class immediately after the H5::DataSet::read() call. The allocated memory for each string is then reclaimed once the instance goes out of scope.

Constructor & Destructor Documentation

◆ ReclaimVlsMemory()

template<class DataTypePointer_ = H5::DataType*, class DataSpacePointer_ = H5::DataSpace*, class DSetMemXferPropListPointer_ = H5::DSetMemXferPropList*>
ritsuko::hdf5::ReclaimVlsMemory< DataTypePointer_, DataSpacePointer_, DSetMemXferPropListPointer_ >::ReclaimVlsMemory ( DataTypePointer_ type_ptr,
DataSpacePointer_ space_ptr,
DSetMemXferPropListPointer_ plist_ptr,
char ** buffer )
inline
Parameters
type_ptrPointer to the HDF5 datatype used to read the strings. If type_ptr is a raw pointer, it should not be deleted before this ReclaimVlsMemory instance is destroyed.
space_ptrPointer to the HDF5 dataspace used to read the strings. If space_ptr is a raw pointer, it should not be deleted before this ReclaimVlsMemory instance is destroyed.
plist_ptrPointer to the memory transfer property list used to read the strings, typically a reference to H5::DSetMemXferPropList::H5P_DEFAULT. If plist_ptr is a raw pointer, it should not be deleted before this ReclaimVlsMemory instance is destroyed.
bufferArray of C-style strings allocated by H5::DataSet::read() with the specified datatype, dataspace and property list.

The documentation for this class was generated from the following file: