9#ifndef H5PROPERTY_LIST_HPP
10#define H5PROPERTY_LIST_HPP
17#include "H5Exception.hpp"
18#include "H5Object.hpp"
25enum class LayoutType :
int {
32static inline LayoutType _convert_layout_type(
const H5D_layout_t& h5type) {
35 return LayoutType::COMPACT;
37 return LayoutType::CONTIGUOUS;
39 return LayoutType::CHUNKED;
41 return LayoutType::VIRTUAL;
43 return static_cast<LayoutType
>(-1);
50enum class PropertyType :
int {
71template <PropertyType T>
78 if (_hid != H5P_DEFAULT) {
84 _hid(other.getId(
true)){};
87 _hid = other.getId(
true);
93 other._hid = H5I_INVALID_HID;
97 constexpr PropertyType getObjectType()
const {
101 hid_t getId(
const bool& increaseRefCount =
false)
const {
102 if (increaseRefCount)
113 _hid(other.getId(
false)){
114 other._hid = H5I_INVALID_HID;
122 std::vector<hsize_t> getChunk(
int max_ndims);
132 setCreateIntermediateGroup(1);
135 void setCreateIntermediateGroup(
unsigned val);
142 void setExternalLinkPrefix(
const std::string& prefix){
166 void setExternalLinkPrefix(
const std::string& prefix){
175 static DataSetCreateProps FromId(
const hid_t&
id,
const bool& increaseRefCount =
false){
176 hid_t prop_class_id = H5Pget_class(
id);
178 if (prop_class_id < 0){
179 HDF5ErrMapper::ToException<PropertyException>(
180 "Unable to get property class");
182 if (H5Pequal(prop_class_id, H5P_DATASET_CREATE) <= 0){
183 HDF5ErrMapper::ToException<PropertyException>(
184 "Property id is of different class");
186 if (increaseRefCount)
200 const std::string& file,
201 off_t offset = 0, hsize_t size = 0);
214 void setDeflate(
const unsigned& level);
216 void setChunk(
const std::initializer_list<hsize_t>& items){
217 std::vector<hsize_t> dims{items};
221 template <
typename... Args>
222 void setChunk(hsize_t item, Args... args){
223 std::vector<hsize_t> dims{item,
static_cast<hsize_t
>(args)...};
227 void setChunk(
const std::vector<hsize_t>& dims);
232 std::string
getExternal(
unsigned idx, off_t& offset, hsize_t& fileSize);
237 std::string getVirtualFileName(
size_t idx);
238 DataSpace getVirtualSrcSpace(
size_t idx);
241 std::vector<hsize_t> getChunk(
int max_ndims);
243 LayoutType getLayoutType();
252 using PropertyList::PropertyList;
259 static DataSetAccessProps FromId(
const hid_t&
id,
const bool& increaseRefCount =
false){
260 hid_t prop_class_id = H5Pget_class(
id);
262 if (prop_class_id < 0){
263 HDF5ErrMapper::ToException<PropertyException>(
264 "Unable to get property class");
266 if (H5Pequal(prop_class_id, H5P_DATASET_ACCESS) <= 0){
267 HDF5ErrMapper::ToException<PropertyException>(
268 "Property id is of different class");
270 if (increaseRefCount)
277 const size_t& numSlots,
const size_t& cacheSize,
278 const double& w0 =
static_cast<double>(H5D_CHUNK_CACHE_W0_DEFAULT));
280 void setExternalLinkPrefix(
const std::string& prefix){
285 size_t& numSlots,
size_t& cacheSize,
double& w0);
287 using PropertyList::PropertyList;
Definition H5PropertyList.hpp:255
Definition H5PropertyList.hpp:171
void addVirtualDataSet(const DataSpace &vSpace, const DataSet &srcDset, const DataSpace &srcSpace)
map source dataset Spaces must have equal number of selected elements Spaces may be given from select...
Definition H5PropertyList_misc.hpp:128
size_t getExternalCount()
return number of external files
Definition H5PropertyList_misc.hpp:171
std::string getExternal(unsigned idx, off_t &offset, hsize_t &fileSize)
retrieve info about external file under index 'idx'
Definition H5PropertyList_misc.hpp:180
std::string getVirtualDataSetName(size_t idx)
resturn virtual (source) dataset name
Definition H5PropertyList_misc.hpp:203
void addExternalFile(const std::string &file, off_t offset=0, hsize_t size=0)
map external binary file to a dataset
Definition H5PropertyList_misc.hpp:111
size_t getVirtualCount()
return number of virtual datasets
Definition H5PropertyList_misc.hpp:193
Class representing a dataset.
Definition H5DataSet.hpp:28
Class representing the space (dimensions) of a dataset.
Definition H5DataSpace.hpp:37
Definition H5PropertyList.hpp:300
Definition H5PropertyList.hpp:295
Definition H5PropertyList.hpp:290
Definition H5PropertyList.hpp:152
Definition H5PropertyList.hpp:147
Definition H5PropertyList.hpp:162
Definition H5PropertyList.hpp:157
Definition H5PropertyList.hpp:138
Definition H5PropertyList.hpp:129
Definition H5PropertyList.hpp:305
Base HDF5 property List.
Definition H5PropertyList.hpp:72
void setExternalLinkPrefix(const std::string &prefix)
setExternalLinkPrefix Let’s say you’ve created an external link in foo.h5 and the external link refer...
Definition H5PropertyList_misc.hpp:79