|
ritsuko
Helper utilities for ArtifactDB C++ code
|
Utilities for reading and validating compressed VLS arrays. More...
Classes | |
| struct | Pointer |
| Pointer into the compressed VLS heap. More... | |
| class | Stream1dArray |
| Stream a 1-dimensional compressed VLS array into memory. More... | |
Functions | |
| template<typename Offset_ , typename Length_ > | |
| H5::CompType | define_pointer_datatype () |
| void | validate_pointer_datatype (const H5::CompType &type, const std::size_t offset_precision, const std::size_t length_precision) |
| void | validate_pointer_datatype (const H5::DataSet &data, const std::size_t offset_precision, const std::size_t length_precision) |
| template<typename Offset_ , typename Length_ > | |
| bool | is_Pointer_out_of_range (const Pointer< Offset_, Length_ > &ptr, const hsize_t heap_length) |
| template<typename Offset_ , typename Length_ > | |
| void | validate_scalar_pointer (const H5::DataSet &data, hsize_t heap_length) |
| template<typename Offset_ , typename Length_ > | |
| void | validate_1d_pointers (const H5::DataSet &data, hsize_t full_length, hsize_t heap_length) |
| template<typename Offset_ , typename Length_ > | |
| void | validate_nd_pointers (const H5::DataSet &data, const std::vector< hsize_t > &dimensions, hsize_t heap_length) |
| void | validate_heap (const H5::DataSet &data) |
Utilities for reading and validating compressed VLS arrays.
| H5::CompType ritsuko::cvls::define_pointer_datatype | ( | ) |
Define a compound datatype of a realization of a Pointer type.
| Offset_ | Unsigned integer type of the starting offset, see Pointer::offset. |
| Length_ | Unsigned integer type of the string length, see Pointer::length. |
| bool ritsuko::cvls::is_Pointer_out_of_range | ( | const Pointer< Offset_, Length_ > & | ptr, |
| const hsize_t | heap_length ) |
| Offset_ | Unsigned integer type of the starting offset, see Pointer::offset. |
| Length_ | Unsigned integer type of the string length, see Pointer::length. |
| ptr | A Pointer specifying an interval on the heap. |
| heap_length | Length of the heap dataset. |
ptr defines an interval within the heap.
|
inline |
Validate the pointer dataset for a 1-dimensional compressed VLS array. An error is thrown if the datatype is not consistent with the expected precision of the Pointer types, or if any pointers are out of range of the associated heap dataset.
| Offset_ | Unsigned integer type for the starting offset on the heap, see Pointer::offset. |
| Length_ | Unsigned integer type for the length of the string, see Pointer::length. |
| data | A HDF5 dataset. It is assumed that this dataset is 1-dimensional. |
| full_length | Length of the dataset, i.e., the extent of its sole dimension. |
| heap_length | Length of the heap dataset. |
|
inline |
Validate a HDF5 dataset containing the compressed VLS heap. An error is thrown if the dataset is not 1-dimensional or does not contain unsigned 8-bit integers.
| data | A HDF5 dataset. It may have any shape and its datatype may be of any class. |
| void ritsuko::cvls::validate_nd_pointers | ( | const H5::DataSet & | data, |
| const std::vector< hsize_t > & | dimensions, | ||
| hsize_t | heap_length ) |
Check that the pointers for an N-dimensional compressed VLS array is valid. An error is thrown if the datatype is not consistent with the expected precision, or if any pointers are out of range of the associated heap dataset.
| Offset_ | Unsigned integer type for the starting offset on the heap, see Pointer::offset. |
| Length_ | Unsigned integer type for the length of the string, see Pointer::length. |
| data | A non-scalar HDF5 dataset. It is assumed that this dataset has at least 1 dimension. |
| dimensions | Dimensions of the dataset. This should be non-empty. |
| heap_length | Length of the heap dataset. |
|
inline |
Validate that a compound HDF5 datatype meets the expectations for storage in a Pointer instance, specifically:
offset and is of an integer datatype that is unsigned and has no more than than offset_precision bits.length and is of an integer datatype that is unsigned and has no more than than length_precision bits.| type | Compound datatype, typically generated from a H5::DataSet instance. |
| offset_precision | Maximum number of bits in the integer type used for the start position, see Pointer::offset. |
| length_precision | Maximum number of bits in the integer type used for the string size, see Pointer::length. |
|
inline |
Overload of validate_pointer_datatype() that accepts a HDF5 dataset. This will throw an error if the HDF5 dataset does not use a compound datatype that satisfies validate_pointer_datatype().
| type | A HDF5 dataset. This may have any datatype. |
| offset_precision | Maximum number of bits in the integer type used for the start position, see Pointer::offset. |
| length_precision | Maximum number of bits in the integer type used for the string size, see Pointer::length. |
|
inline |
Validate the pointer dataset for a compressed VLS scalar. An error is thrown if the datatype is not consistent with the expected precision of the Pointer types, or if the pointer is out of range of the associated heap dataset.
| Offset_ | Unsigned integer type for the starting offset on the heap, see Pointer::offset. |
| Length_ | Unsigned integer type for the length of the string, see Pointer::length. |
| data | A HDF5 dataset. It is assumed that this dataset is scalar. |
| heap_length | Length of the heap dataset. |