ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
ReclaimVlsMemory.hpp
Go to the documentation of this file.
1#ifndef RITSUKO_HDF5_RECLAIM_VLS_MEMORY_HPP
2#define RITSUKO_HDF5_RECLAIM_VLS_MEMORY_HPP
3
4#include <type_traits>
5
6#include "H5Cpp.h"
7
8#include "../utils.hpp"
9
15namespace ritsuko {
16
17namespace hdf5 {
18
33template<
34 class DataTypePointer_ = H5::DataType*,
35 class DataSpacePointer_ = H5::DataSpace*,
36 class DSetMemXferPropListPointer_ = H5::DSetMemXferPropList*
37>
39public:
50 DataTypePointer_ type_ptr,
51 DataSpacePointer_ space_ptr,
52 DSetMemXferPropListPointer_ plist_ptr,
53 char** buffer
54 ) :
55 my_type_ptr(std::move(type_ptr)),
56 my_space_ptr(std::move(space_ptr)),
57 my_plist_ptr(std::move(plist_ptr)),
58 my_buffer(buffer)
59 {}
60
65 H5Dvlen_reclaim(my_type_ptr->getId(), my_space_ptr->getId(), my_plist_ptr->getId(), my_buffer);
66 }
71private:
72 DataTypePointer_ my_type_ptr;
73 DataSpacePointer_ my_space_ptr;
74 DSetMemXferPropListPointer_ my_plist_ptr;
75 char** my_buffer;
76
77 static_assert(std::is_base_of<H5::DataType, I<decltype(*my_type_ptr)> >::value);
78 static_assert(std::is_base_of<H5::DataSpace, I<decltype(*my_space_ptr)> >::value);
79 static_assert(std::is_base_of<H5::DSetMemXferPropList, I<decltype(*my_plist_ptr)> >::value);
80};
81
82}
83
84}
85
86#endif
Reclaim memory for HDF5's variable length strings.
Definition ReclaimVlsMemory.hpp:38
ReclaimVlsMemory(DataTypePointer_ type_ptr, DataSpacePointer_ space_ptr, DSetMemXferPropListPointer_ plist_ptr, char **buffer)
Definition ReclaimVlsMemory.hpp:49
Helper functions for ArtifactDB parsing and validation.
Definition Pointer.hpp:22