ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
ritsuko::hdf5::Stream1dNumericDataset< Type_ > Class Template Reference

Stream a numeric 1-dimensional HDF5 dataset into memory. More...

#include <Stream1dNumericDataset.hpp>

Public Member Functions

 Stream1dNumericDataset (const H5::DataSet *ptr, hsize_t length, hsize_t buffer_size)
 
 Stream1dNumericDataset (const H5::DataSet *ptr, hsize_t buffer_size)
 
Type_ get ()
 
std::pair< const Type_ *, size_t > get_many ()
 
void next (size_t jump=1)
 
hsize_t length () const
 
hsize_t position () const
 

Detailed Description

template<typename Type_>
class ritsuko::hdf5::Stream1dNumericDataset< Type_ >

Stream a numeric 1-dimensional HDF5 dataset into memory.

Template Parameters
Type_Type to represent the data in memory.

This streams in a 1-dimensional HDF5 numeric dataset in contiguous blocks, using block sizes defined by pick_1d_block_size(). Callers can then extract one value at a time or they can acquire the entire block.

Constructor & Destructor Documentation

◆ Stream1dNumericDataset() [1/2]

template<typename Type_ >
ritsuko::hdf5::Stream1dNumericDataset< Type_ >::Stream1dNumericDataset ( const H5::DataSet * ptr,
hsize_t length,
hsize_t buffer_size )
inline
Parameters
ptrPointer to a HDF5 dataset handle.
lengthLength of the dataset as a 1-dimensional vector.
buffer_sizeSize of the buffer for holding streamed blocks of values. Larger buffers improve speed at the cost of some memory efficiency.

◆ Stream1dNumericDataset() [2/2]

template<typename Type_ >
ritsuko::hdf5::Stream1dNumericDataset< Type_ >::Stream1dNumericDataset ( const H5::DataSet * ptr,
hsize_t buffer_size )
inline

Overloaded constructor where the length is automatically determined.

Parameters
ptrPointer to a HDF5 dataset handle.
buffer_sizeSize of the buffer for holding streamed blocks of values.

Member Function Documentation

◆ get()

template<typename Type_ >
Type_ ritsuko::hdf5::Stream1dNumericDataset< Type_ >::get ( )
inline
Returns
Value at the current position of the stream.

◆ get_many()

template<typename Type_ >
std::pair< const Type_ *, size_t > ritsuko::hdf5::Stream1dNumericDataset< Type_ >::get_many ( )
inline
Returns
Pair containing a pointer to and the length of an array. The array holds all loaded values of the stream at its current position, up to the specified length. Note that the pointer is only valid until the next invocation of next().

◆ length()

template<typename Type_ >
hsize_t ritsuko::hdf5::Stream1dNumericDataset< Type_ >::length ( ) const
inline
Returns
Length of the dataset.

◆ next()

template<typename Type_ >
void ritsuko::hdf5::Stream1dNumericDataset< Type_ >::next ( size_t jump = 1)
inline

Advance the position of the stream by jump.

Parameters
jumpNumber of positions by which to advance the stream.

◆ position()

template<typename Type_ >
hsize_t ritsuko::hdf5::Stream1dNumericDataset< Type_ >::position ( ) const
inline
Returns
Current position on the stream.

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