ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
ritsuko::hdf5 Namespace Reference

Assorted helper functions for HDF5 parsing. More...

Namespaces

namespace  vls
 Assorted functions for handling ritsuko's custom VLS arrays.
 

Classes

struct  IterateNdDataset
 Iterate through an N-dimensional dataset by block. More...
 
class  Stream1dNumericDataset
 Stream a numeric 1-dimensional HDF5 dataset into memory. More...
 
class  Stream1dStringDataset
 Stream a 1-dimensional HDF5 string dataset into memory. More...
 

Functions

template<typename Type_ >
const H5::PredType & as_numeric_datatype ()
 
bool exceeds_integer_limit (const H5::IntType &itype, size_t precision, bool is_signed)
 
bool exceeds_integer_limit (const H5::DataSet &handle, size_t precision, bool is_signed)
 
bool exceeds_integer_limit (const H5::Attribute &handle, size_t precision, bool is_signed)
 
bool exceeds_float_limit (const H5::DataSet &handle, size_t precision)
 
bool exceeds_float_limit (const H5::Attribute &handle, size_t precision)
 
hsize_t get_1d_length (const H5::DataSpace &space, bool allow_scalar)
 
hsize_t get_1d_length (const H5::DataSet &handle, bool allow_scalar)
 
hsize_t get_1d_length (const H5::Attribute &handle, bool allow_scalar)
 
bool is_scalar (const H5::DataSpace &space)
 
bool is_scalar (const H5::DataSet &handle)
 
bool is_scalar (const H5::Attribute &handle)
 
std::vector< hsize_t > get_dimensions (const H5::DataSpace &space, bool allow_scalar)
 
std::vector< hsize_t > get_dimensions (const H5::DataSet &handle, bool allow_scalar)
 
std::vector< hsize_t > get_dimensions (const H5::Attribute &handle, bool allow_scalar)
 
template<class Handle_ >
std::string get_name (const Handle_ &handle)
 
bool is_utf8_string (const H5::StrType &stype)
 
bool is_utf8_string (const H5::DataSet &handle)
 
bool is_utf8_string (const H5::Attribute &handle)
 
std::string load_scalar_string_attribute (const H5::Attribute &attr)
 
std::vector< std::string > load_1d_string_attribute (const H5::Attribute &attr, hsize_t full_length)
 
std::vector< std::string > load_1d_string_attribute (const H5::Attribute &attr)
 
template<typename Type_ >
Type_ load_scalar_numeric_attribute (const H5::Attribute &attr)
 
template<typename Type_ >
std::vector< Type_ > load_1d_numeric_attribute (const H5::Attribute &attr, hsize_t full_length)
 
template<typename Type_ >
std::vector< Type_ > load_1d_numeric_attribute (const H5::Attribute &attr)
 
std::string load_scalar_string_dataset (const H5::DataSet &handle)
 
std::vector< std::string > load_1d_string_dataset (const H5::DataSet &handle, hsize_t full_length, hsize_t buffer_size)
 
std::vector< std::string > load_1d_string_dataset (const H5::DataSet &handle, hsize_t buffer_size)
 
template<typename Type_ >
Type_ load_scalar_numeric_dataset (const H5::DataSet &handle)
 
template<typename Type_ >
std::vector< Type_ > load_1d_numeric_dataset (const H5::DataSet &handle, hsize_t full_length, hsize_t buffer_size)
 
template<typename Type_ >
std::vector< Type_ > load_1d_numeric_dataset (const H5::DataSet &handle, hsize_t buffer_size)
 
template<class H5Object_ >
H5::Attribute open_scalar_attribute (const H5Object_ &handle, const char *name)
 
template<class H5Object_ >
std::string open_and_load_scalar_string_attribute (const H5Object_ &handle, const char *name, bool utf8=true)
 
void check_numeric_missing_placeholder_attribute (const H5::DataSet &dset, const H5::Attribute &attr, bool type_class_only=false)
 
template<typename Type_ >
std::optional< Type_ > open_and_load_optional_numeric_missing_placeholder (const H5::DataSet &handle, const char *attr_name)
 
void check_string_missing_placeholder_attribute (const H5::Attribute &attr)
 
std::optional< std::string > open_and_load_optional_string_missing_placeholder (const H5::DataSet &handle, const char *attr_name)
 
template<class Path_ >
H5::H5File open_file (const Path_ &path)
 
H5::Group open_group (const H5::Group &handle, const char *name)
 
H5::DataSet open_dataset (const H5::Group &handle, const char *name)
 
template<class Object_ >
H5::Attribute open_attribute (const Object_ &handle, const char *name)
 
hsize_t pick_1d_block_size (const H5::DSetCreatPropList &cplist, hsize_t full_length, hsize_t buffer_size=10000)
 
std::vector< hsize_t > pick_nd_block_dimensions (const H5::DSetCreatPropList &cplist, const std::vector< hsize_t > &dimensions, hsize_t buffer_size=10000)
 
void validate_scalar_string_dataset (const H5::DataSet &handle)
 
void validate_1d_string_dataset (const H5::DataSet &handle, hsize_t full_length, hsize_t buffer_size)
 
void validate_1d_string_dataset (const H5::DataSet &handle, hsize_t buffer_size)
 
void validate_nd_string_dataset (const H5::DataSet &handle, const std::vector< hsize_t > &dimensions, hsize_t buffer_size)
 
void validate_nd_string_dataset (const H5::DataSet &handle, hsize_t buffer_size)
 
void validate_scalar_string_attribute (const H5::Attribute &attr)
 
void validate_1d_string_attribute (const H5::Attribute &attr, hsize_t full_length)
 
void validate_1d_string_attribute (const H5::Attribute &attr)
 

Detailed Description

Assorted helper functions for HDF5 parsing.

Function Documentation

◆ as_numeric_datatype()

template<typename Type_ >
const H5::PredType & ritsuko::hdf5::as_numeric_datatype ( )

Choose the HDF5 datatype object corresponding to a particular C++ numeric type.

Template Parameters
Type_A numeric C++ type. This can be any of the fixed-width integers, float or double. Some of the non-fixed integer types are also supported.
Returns
Reference to a HDF5 datatype object.

◆ check_numeric_missing_placeholder_attribute()

void ritsuko::hdf5::check_numeric_missing_placeholder_attribute ( const H5::DataSet & dset,
const H5::Attribute & attr,
bool type_class_only = false )
inline

Check the validity of a missing placeholder attribute on a numeric dataset. An error is raised if the attribute is not a scalar or has a different type (or type class, if type_class_only = true) to the dataset.

Parameters
dsetDataset handle.
attrHandle for the attribute containing the missing placeholder, typically attached to dset.
type_class_onlyWhether to only require identical type classes for the placeholder. If false, the types between dset and attr must be identical.

◆ check_string_missing_placeholder_attribute()

void ritsuko::hdf5::check_string_missing_placeholder_attribute ( const H5::Attribute & attr)
inline

Check the validity of a missing placeholder attribute on a string dataset. An error is raised if the attribute is not a scalar or has a different type class. For variable length string attributes, this function will also check that the string is not NULL.

Parameters
attrHandle for the attribute containing the missing placeholder.

◆ exceeds_float_limit() [1/2]

bool ritsuko::hdf5::exceeds_float_limit ( const H5::Attribute & handle,
size_t precision )
inline

Overload of exceeds_float_limit() that accepts a HDF5 attribute handle.

Parameters
handleHandle for a HDF5 attribute.
precisionNumber of bits in the limiting float type.
Returns
Whether the attribute uses a datatype than cannot be represented by the limiting integer type. true is also returned for non-numeric attributes.

◆ exceeds_float_limit() [2/2]

bool ritsuko::hdf5::exceeds_float_limit ( const H5::DataSet & handle,
size_t precision )
inline

Check if a HDF5 datatype could hold values beyond the range of a limiting (IEEE754-compliant) float type. This is used by validators to ensure that a dataset can be represented in memory by the limiting type.

Note that the limiting float type is assumed to be IEEE754-compliant. If the HDF5 datatype is not also IEEE754-compliant, it will be considered out-of-range regardless of its precision. This is necessary as non-IEEE754 floats could have an arbitrary split of bits between the exponent and significand, such that two float datatypes with the same number of bits could represent a different set of numbers. (Though this seems unlikely in practice, as all CPU-specific predefined float types in later HDF5 versions are already aliases of the IEEE types.)

Parameters
handleHandle for a HDF5 dataset.
precisionNumber of bits in the limiting float type.
Returns
Whether the dataset uses a datatype than cannot be represented by the limiting float type. true is also returned for non-numeric datasets.

◆ exceeds_integer_limit() [1/3]

bool ritsuko::hdf5::exceeds_integer_limit ( const H5::Attribute & handle,
size_t precision,
bool is_signed )
inline

Overload of exceeds_integer_limit() that accepts a HDF5 attribute handle.

Parameters
handleHandle for a HDF5 attribute.
precisionNumber of bits in the limiting integer type, assuming 2's complement.
is_signedWhether the limiting integer type is signed.
Returns
Whether the attribute uses a datatype than cannot be represented by the limiting integer type.

◆ exceeds_integer_limit() [2/3]

bool ritsuko::hdf5::exceeds_integer_limit ( const H5::DataSet & handle,
size_t precision,
bool is_signed )
inline

Overload of exceeds_integer_limit() that accepts a HDF5 dataset handle.

Parameters
handleHandle for a HDF5 dataset.
precisionNumber of bits in the limiting integer type, assuming 2's complement.
is_signedWhether the limiting integer type is signed.
Returns
Whether the dataset uses a datatype than cannot be represented by the limiting integer type.

◆ exceeds_integer_limit() [3/3]

bool ritsuko::hdf5::exceeds_integer_limit ( const H5::IntType & itype,
size_t precision,
bool is_signed )
inline

Check if a HDF5 datatype could hold values beyond the range of a limiting integer type. This is used by validators to ensure that a dataset can be represented in memory by the limiting type.

Parameters
itypeHDF5 integer datatype.
precisionNumber of bits in the limiting integer type, assuming 2's complement.
is_signedWhether the limiting integer type is signed.
Returns
Whether the datatype cannot be represented by the limiting integer type. true is also returned for non-integer datasets.

◆ get_1d_length() [1/3]

hsize_t ritsuko::hdf5::get_1d_length ( const H5::Attribute & handle,
bool allow_scalar )
inline

Overload of get_1d_length() that accepts an attribute handle.

Parameters
handleHandle to a HDF5 attribute.
allow_scalarWhether to allow scalars.
Returns
Length of the attribute, i.e., the extent of its single dimension.

◆ get_1d_length() [2/3]

hsize_t ritsuko::hdf5::get_1d_length ( const H5::DataSet & handle,
bool allow_scalar )
inline

Overload of get_1d_length() that accepts a dataset handle.

Parameters
handleHandle to a HDF5 dataset.
allow_scalarWhether to allow scalars.
Returns
Length of the dataset, i.e., the extent of its single dimension.

◆ get_1d_length() [3/3]

hsize_t ritsuko::hdf5::get_1d_length ( const H5::DataSpace & space,
bool allow_scalar )
inline

Get the length of a 1-dimensional HDF5 dataset.

Parameters
spaceThe data space of the dataset.
allow_scalarWhether to allow scalars.
Returns
Length of the dataset, i.e., the extent of its single dimension. If allow_scalar = true, zero is returned in the presence of a scalar dataset, otherwise an error is raised.

◆ get_dimensions() [1/3]

std::vector< hsize_t > ritsuko::hdf5::get_dimensions ( const H5::Attribute & handle,
bool allow_scalar )
inline

Overload of get_dimensions() that accepts an attribute handle.

Parameters
handleHandle to a HDF5 attribute.
allow_scalarWhether to allow scalars.
Returns
Dimensions of the attribute.

◆ get_dimensions() [2/3]

std::vector< hsize_t > ritsuko::hdf5::get_dimensions ( const H5::DataSet & handle,
bool allow_scalar )
inline

Overload of get_dimensions() that accepts a dataset handle.

Parameters
handleHandle to a HDF5 dataset.
allow_scalarWhether to allow scalars.
Returns
Dimensions of the dataset.

◆ get_dimensions() [3/3]

std::vector< hsize_t > ritsuko::hdf5::get_dimensions ( const H5::DataSpace & space,
bool allow_scalar )
inline

Get the dimensions of a dataset.

Parameters
spaceThe data space of the dataset.
allow_scalarWhether to allow scalars.
Returns
Dimensions of the dataset. If allow_scalar = true, a zero-length vector is returned in the presence of a scalar dataset, otherwise an error is raised.

◆ get_name()

template<class Handle_ >
std::string ritsuko::hdf5::get_name ( const Handle_ & handle)

Get the name of a HDF5 object from its handle, usually for printing informative error messages.

Template Parameters
Handle_Type of HDF5 handle, usually a Group, DataSet or Attribute.
Parameters
handleHandle to a HDF5 object.
Returns
Name of the HDF5 object inside the file.

◆ is_scalar() [1/3]

bool ritsuko::hdf5::is_scalar ( const H5::Attribute & handle)
inline

Overload of is_scalar() that accepts an attribute handle.

Parameters
handleHandle to a HDF5 attribute.
Returns
Whether space represents a scalar dataset.

◆ is_scalar() [2/3]

bool ritsuko::hdf5::is_scalar ( const H5::DataSet & handle)
inline

Overload of is_scalar() that accepts a dataset handle.

Parameters
handleHandle to a HDF5 dataset.
Returns
Whether space represents a scalar dataset.

◆ is_scalar() [3/3]

bool ritsuko::hdf5::is_scalar ( const H5::DataSpace & space)
inline
Parameters
spaceThe data space of the dataset.
Returns
Whether space represents a scalar dataset.

◆ is_utf8_string() [1/3]

bool ritsuko::hdf5::is_utf8_string ( const H5::Attribute & handle)
inline

Overload of is_utf8_string() that accepts a HDF5 attribute handle.

Parameters
handleHandle for a HDF5 attribute.
Returns
Whether the attribute holds strings that use UTF-8 (or ASCII) encoding.

◆ is_utf8_string() [2/3]

bool ritsuko::hdf5::is_utf8_string ( const H5::DataSet & handle)
inline

Overload of is_utf8_string() that accepts a HDF5 dataset handle.

Parameters
handleHandle for a HDF5 dataset.
Returns
Whether the dataset holds strings that use UTF-8 (or ASCII) encoding.

◆ is_utf8_string() [3/3]

bool ritsuko::hdf5::is_utf8_string ( const H5::StrType & stype)
inline

Check if a HDF5 string datatype could represent strings that are not compatible with the UTF-8 encoding.

Note that this returns true even if the string datatype uses ASCII encoding, given that ASCII is a subset of UTF-8. As a result, this function is mostly performative as all valid HDF5 strings are encoded in either ASCII or UTF-8; nonetheless, we run these checks to be explicit and to protect against the future addition of more encodings.

Parameters
stypeHDF5 string datatype.
Returns
Whether stype uses UTF-8 (or ASCII) encoding.

◆ load_1d_numeric_attribute() [1/2]

template<typename Type_ >
std::vector< Type_ > ritsuko::hdf5::load_1d_numeric_attribute ( const H5::Attribute & attr)

Overload of load_1d_numeric_attribute() that determines the length of the attribute via get_1d_length().

Template Parameters
Type_Type for holding the data in memory, see as_numeric_datatype() for supported types.
Parameters
attrHandle to a numeric attribute. Callers are responsible for checking that the datatype of attr is appropriate for Type_, e.g., with exceeds_integer_limit().
Returns
Vector containing the contents of the attribute.

◆ load_1d_numeric_attribute() [2/2]

template<typename Type_ >
std::vector< Type_ > ritsuko::hdf5::load_1d_numeric_attribute ( const H5::Attribute & attr,
hsize_t full_length )
Template Parameters
Type_Type for holding the data in memory, see as_numeric_datatype() for supported types.
Parameters
attrHandle to a numeric attribute. Callers are responsible for checking that the datatype of attr is appropriate for Type_, e.g., with exceeds_integer_limit().
full_lengthLength of the attribute in attr, usually obtained by get_1d_length().
Returns
Vector containing the contents of the attribute.

◆ load_1d_numeric_dataset() [1/2]

template<typename Type_ >
std::vector< Type_ > ritsuko::hdf5::load_1d_numeric_dataset ( const H5::DataSet & handle,
hsize_t buffer_size )

Overload of load_1d_numeric_dataset() that determines the length via get_1d_length().

Template Parameters
Type_Type of the number in memory.
Parameters
handleHandle to the HDF5 dataset.
buffer_sizeSize of the buffer for holding loaded strings.
Returns
Vector of numbers.

◆ load_1d_numeric_dataset() [2/2]

template<typename Type_ >
std::vector< Type_ > ritsuko::hdf5::load_1d_numeric_dataset ( const H5::DataSet & handle,
hsize_t full_length,
hsize_t buffer_size )

Load a 1-dimensional numeric dataset into a vector.

Template Parameters
Type_Type of the number in memory.
Parameters
handleHandle to the HDF5 dataset.
full_lengthLength of the dataset as a 1-dimensional vector.
buffer_sizeSize of the buffer for holding loaded strings.
Returns
Vector of numbers.

◆ load_1d_string_attribute() [1/2]

std::vector< std::string > ritsuko::hdf5::load_1d_string_attribute ( const H5::Attribute & attr)
inline

Overload of load_1d_string_attribute() that determines the length of the attribute via get_1d_length().

Parameters
attrHandle to a 1-dimensional string attribute. Callers are responsible for checking that attr contains a string datatype class.
Returns
Vector of strings.

◆ load_1d_string_attribute() [2/2]

std::vector< std::string > ritsuko::hdf5::load_1d_string_attribute ( const H5::Attribute & attr,
hsize_t full_length )
inline
Template Parameters
check_Whether to check that attr is a 1-dimensional string attribute.
Parameters
attrHandle to a 1-dimensional string attribute. Callers are responsible for checking that attr contains a string datatype class.
full_lengthLength of the attribute in attr, usually obtained by get_1d_length().
Returns
Vector of strings.

◆ load_1d_string_dataset() [1/2]

std::vector< std::string > ritsuko::hdf5::load_1d_string_dataset ( const H5::DataSet & handle,
hsize_t buffer_size )
inline

Overload of load_1d_string_dataset() that determines the length via get_1d_length().

Parameters
handleHandle to the 1-dimensional HDF5 dataset.
buffer_sizeSize of the buffer for holding loaded strings.
Returns
Vector of strings.

◆ load_1d_string_dataset() [2/2]

std::vector< std::string > ritsuko::hdf5::load_1d_string_dataset ( const H5::DataSet & handle,
hsize_t full_length,
hsize_t buffer_size )
inline

Load a 1-dimensional string dataset into a vector of strings.

Parameters
handleHandle to the 1-dimensional HDF5 dataset.
full_lengthLength of the dataset as a 1-dimensional vector.
buffer_sizeSize of the buffer for holding loaded strings.
Returns
Vector of strings.

◆ load_scalar_numeric_attribute()

template<typename Type_ >
Type_ ritsuko::hdf5::load_scalar_numeric_attribute ( const H5::Attribute & attr)
Template Parameters
Type_Type for holding the data in memory, see as_numeric_datatype() for supported types.
Parameters
attrHandle to a scalar numeric attribute. Callers are responsible for checking that the datatype of attr is appropriate for Type_, e.g., with exceeds_integer_limit().
Returns
The value of the attribute.

◆ load_scalar_numeric_dataset()

template<typename Type_ >
Type_ ritsuko::hdf5::load_scalar_numeric_dataset ( const H5::DataSet & handle)

Load a scalar numeric dataset into a single number.

Template Parameters
Type_Type of the number in memory.
Parameters
handleHandle to the HDF5 scalar dataset.
Returns
Number containing the value of the sole dataset entry.

◆ load_scalar_string_attribute()

std::string ritsuko::hdf5::load_scalar_string_attribute ( const H5::Attribute & attr)
inline
Parameters
attrHandle to a scalar string attribute. Callers are responsible for checking that attr contains a string datatype class.
Returns
The attribute as a string.

◆ load_scalar_string_dataset()

std::string ritsuko::hdf5::load_scalar_string_dataset ( const H5::DataSet & handle)
inline

Load a scalar string dataset into a single string.

Parameters
handleHandle to the HDF5 scalar dataset.
Returns
String containing the contents of the sole dataset entry.

◆ open_and_load_optional_numeric_missing_placeholder()

template<typename Type_ >
std::optional< Type_ > ritsuko::hdf5::open_and_load_optional_numeric_missing_placeholder ( const H5::DataSet & handle,
const char * attr_name )

Check if a missing placeholder attribute is present, and if so, open it and loads it value. This will also call check_numeric_missing_placeholder_attribute() to validate the placeholder's properties.

Template Parameters
Type_Type to use to store the data in memory, see as_numeric_datatype() for supported types.
Parameters
handleDataset handle.
attr_nameName of the attribute containing the missing value placeholder.
Returns
Optional value of the placeholder.

◆ open_and_load_optional_string_missing_placeholder()

std::optional< std::string > ritsuko::hdf5::open_and_load_optional_string_missing_placeholder ( const H5::DataSet & handle,
const char * attr_name )
inline

Check if a missing string placeholder attribute is present, and if so, open it and loads it value. This will also call check_string_missing_placeholder_attribute() to validate the placeholder's properties.

Parameters
handleDataset handle.
attr_nameName of the attribute containing the missing value placeholder.
Returns
Optional value of the placeholder.

◆ open_and_load_scalar_string_attribute()

template<class H5Object_ >
std::string ritsuko::hdf5::open_and_load_scalar_string_attribute ( const H5Object_ & handle,
const char * name,
bool utf8 = true )
Template Parameters
Object_Type of the HDF5 handle, usually a DataSet or Group.
Parameters
handleHDF5 dataset or group handle.
nameName of the attribute.
utf8Whether to check for a UTF-8 encoding.
Returns
A string containing the attribute value. This function will fail if the attribute at name is not scalar or does not use a string datatype. If utf8 = true, it was also fail if the datatype does not use a UTF-8 compatible encoding.

◆ open_attribute()

template<class Object_ >
H5::Attribute ritsuko::hdf5::open_attribute ( const Object_ & handle,
const char * name )
Template Parameters
Object_Type of the HDF5 handle, usually a DataSet or Group.
Parameters
handleHDF5 dataset or group handle.
nameName of the attribute.
Returns
Attribute handle. An error is raised if name does not refer to an attribute.

◆ open_dataset()

H5::DataSet ritsuko::hdf5::open_dataset ( const H5::Group & handle,
const char * name )
inline
Parameters
handleGroup containing the dataset.
nameName of the dataset inside the group.
Returns
Handle to the dataset. An error is raised if name does not refer to a dataset.

◆ open_file()

template<class Path_ >
H5::H5File ritsuko::hdf5::open_file ( const Path_ & path)
inline
Parameters
pathPath to a HDF5 file.
Template Parameters
Path_Type of the path, either as a C-style array, a std::string, or a filesystem::path.
Returns
Handle to the file. An error is raised if path does not exist.

◆ open_group()

H5::Group ritsuko::hdf5::open_group ( const H5::Group & handle,
const char * name )
inline
Parameters
handleParent group (or file).
nameName of the group.
Returns
Handle to the group. An error is raised if name does not refer to a dataset.

◆ open_scalar_attribute()

template<class H5Object_ >
H5::Attribute ritsuko::hdf5::open_scalar_attribute ( const H5Object_ & handle,
const char * name )
inline
Template Parameters
Object_Type of the HDF5 handle, usually a DataSet or Group.
Parameters
handleHDF5 dataset or group handle.
nameName of the attribute.
Returns
Attribute handle. An error is raised if name does not refer to a scalar attribute.

◆ pick_1d_block_size()

hsize_t ritsuko::hdf5::pick_1d_block_size ( const H5::DSetCreatPropList & cplist,
hsize_t full_length,
hsize_t buffer_size = 10000 )
inline

Pick a block size to use for 1-dimensional iteration over a dataset. For compressed datasets, this aims to be the smallest multiple of the chunk size that fits into a buffer.

Parameters
cplistThe creation property list for this dataset.
full_lengthLength of this dataset, e.g., from get_1d_length().
buffer_sizeSize of the buffer in terms of the number of elements. Smaller values reduce peak memory usage at the cost of more iterations.
Returns
The block size (in terms of the number of elements).

◆ pick_nd_block_dimensions()

std::vector< hsize_t > ritsuko::hdf5::pick_nd_block_dimensions ( const H5::DSetCreatPropList & cplist,
const std::vector< hsize_t > & dimensions,
hsize_t buffer_size = 10000 )
inline

Pick block dimensions to use for iteration over an N-dimensional dataset. For compressed datasets, this aims to be the smallest multiple of the chunk size that fits into a buffer.

Parameters
cplistThe creation property list for this dataset.
dimensionsDimensions of this dataset.
buffer_sizeSize of the buffer in terms of the number of elements. Smaller values reduce peak memory usage at the cost of more iterations.
Returns
The block dimensions.

◆ validate_1d_string_attribute() [1/2]

void ritsuko::hdf5::validate_1d_string_attribute ( const H5::Attribute & attr)
inline

Overload for validate_1d_string_attribute() that automatically determines its length via get_1d_length().

Parameters
attrHandle to the HDF5 string attribute.

◆ validate_1d_string_attribute() [2/2]

void ritsuko::hdf5::validate_1d_string_attribute ( const H5::Attribute & attr,
hsize_t full_length )
inline

Check that a 1-dimensional string attribute is valid. Currently, this involves checking that there are no NULL entries for variable-length string datatypes. For fixed-width string attributes, this function is a no-op.

Parameters
attrHandle to the HDF5 string attribute.
full_lengthLength of the attribute as a 1-dimensional vector.

◆ validate_1d_string_dataset() [1/2]

void ritsuko::hdf5::validate_1d_string_dataset ( const H5::DataSet & handle,
hsize_t buffer_size )
inline

Overload for validate_1d_string_dataset() that automatically determines its length via get_1d_length().

Parameters
handleHandle to the HDF5 string dataset.
buffer_sizeSize of the buffer for holding loaded strings.

◆ validate_1d_string_dataset() [2/2]

void ritsuko::hdf5::validate_1d_string_dataset ( const H5::DataSet & handle,
hsize_t full_length,
hsize_t buffer_size )
inline

Check that a 1-dimensional string dataset is valid. Currently, this involves checking that there are no NULL entries for variable-length string datatypes. For fixed-width string datasets, this function is a no-op.

Parameters
handleHandle to the HDF5 string dataset.
full_lengthLength of the dataset as a 1-dimensional vector.
buffer_sizeSize of the buffer for holding loaded strings.

◆ validate_nd_string_dataset() [1/2]

void ritsuko::hdf5::validate_nd_string_dataset ( const H5::DataSet & handle,
const std::vector< hsize_t > & dimensions,
hsize_t buffer_size )
inline

Check that an N-dimensional string dataset is valid. Currently, this involves checking that there are no NULL entries for variable-length string datatypes. For fixed-width string datasets, this function is a no-op.

Parameters
handleHandle to the HDF5 string dataset.
dimensionsDimensions of the dataset.
buffer_sizeSize of the buffer for holding loaded strings.

◆ validate_nd_string_dataset() [2/2]

void ritsuko::hdf5::validate_nd_string_dataset ( const H5::DataSet & handle,
hsize_t buffer_size )
inline

Overload for validate_nd_string_dataset() that automatically determines the dimensions.

Parameters
handleHandle to the HDF5 string dataset.
buffer_sizeSize of the buffer for holding loaded strings.

◆ validate_scalar_string_attribute()

void ritsuko::hdf5::validate_scalar_string_attribute ( const H5::Attribute & attr)
inline

Check that a scalar string attribute is valid. Currently, this involves checking that there are no NULL entries for variable-length string datatypes. For fixed-width string attributes, this function is a no-op.

Parameters
attrHandle to the HDF5 string attribute.

◆ validate_scalar_string_dataset()

void ritsuko::hdf5::validate_scalar_string_dataset ( const H5::DataSet & handle)
inline

Check that a scalar string dataset is valid. Currently, this involves checking that there are no NULL entries for variable-length string datatypes. For fixed-width string datasets, this function is a no-op.

Parameters
handleHandle to the HDF5 string dataset.