HighFive 2.10.1
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
HighFive::SliceTraits< Derivate > Class Template Reference

#include <H5Slice_traits.hpp>

Public Member Functions

Selection select (const HyperSlab &hyperslab) const
 Select an hyperslab in the current Slice/Dataset.
 
Selection select (const HyperSlab &hyperslab, const DataSpace &memspace) const
 Select an hyperslab in the current Slice/Dataset.
 
Selection select (const std::vector< size_t > &offset, const std::vector< size_t > &count, const std::vector< size_t > &stride={}, const std::vector< size_t > &block={}) const
 Select a region in the current Slice/Dataset of count points at offset separated by stride. If strides are not provided they will default to 1 in all dimensions.
 
Selection select (const std::vector< size_t > &columns) const
 Select a set of columns in the last dimension of this dataset.
 
Selection select (const ElementSet &elements) const
 Select a region in the current Slice/Dataset out of a list of elements.
 
template<typename T >
read (const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void read (T &array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void read (T *array, const DataType &dtype, const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void read (T *array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void read_raw (T *array, const DataType &dtype, const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void read_raw (T *array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
template<typename T >
void write (const T &buffer, const DataTransferProps &xfer_props=DataTransferProps())
 
template<typename T >
void write_raw (const T *buffer, const DataType &mem_datatype, const DataTransferProps &xfer_props=DataTransferProps())
 
template<typename T >
void write_raw (const T *buffer, const DataTransferProps &xfer_props=DataTransferProps())
 

Member Function Documentation

◆ read() [1/4]

template<typename Derivate >
template<typename T >
T HighFive::SliceTraits< Derivate >::read ( const DataTransferProps & xfer_props = DataTransferProps()) const
inline

◆ read() [2/4]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read ( T & array,
const DataTransferProps & xfer_props = DataTransferProps() ) const
inline

Read the entire dataset into a buffer

An exception is raised is if the numbers of dimension of the buffer and of the dataset are different.

The array type can be a N-pointer or a N-vector. For plain pointers not dimensionality checking will be performed, it is the user's responsibility to ensure that the right amount of space has been allocated.

◆ read() [3/4]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read ( T * array,
const DataTransferProps & xfer_props = DataTransferProps() ) const
inline

Read the entire dataset into a raw buffer

Deprecated
Use read_raw instead.

Same as read(T*, const DataType&, const DataTransferProps&). However, this overload deduces the HDF5 datatype of the element of array from T. Note, that the file datatype is already fixed.

Parameters
arrayA buffer containing enough space for the data
xfer_propsData Transfer properties

◆ read() [4/4]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read ( T * array,
const DataType & dtype,
const DataTransferProps & xfer_props = DataTransferProps() ) const
inline

Read the entire dataset into a raw buffer

Deprecated
Use read_raw instead.

No dimensionality checks will be performed, it is the user's responsibility to ensure that the right amount of space has been allocated.

Parameters
arrayA buffer containing enough space for the data
dtypeThe datatype of elements of the in memory buffer.
xfer_propsData Transfer properties

◆ read_raw() [1/2]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read_raw ( T * array,
const DataTransferProps & xfer_props = DataTransferProps() ) const
inline

Read the entire dataset into a raw buffer

Same as read(T*, const DataType&, const DataTransferProps&). However, this overload deduces the HDF5 datatype of the element of array from T. Note, that the file datatype is already fixed.

Parameters
arrayA buffer containing enough space for the data
xfer_propsData Transfer properties

◆ read_raw() [2/2]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read_raw ( T * array,
const DataType & dtype,
const DataTransferProps & xfer_props = DataTransferProps() ) const
inline

Read the entire dataset into a raw buffer

No dimensionality checks will be performed, it is the user's responsibility to ensure that the right amount of space has been allocated.

Parameters
arrayA buffer containing enough space for the data
dtypeThe type of the data, in case it cannot be automatically guessed
xfer_propsData Transfer properties

◆ select() [1/5]

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select ( const ElementSet & elements) const
inline

Select a region in the current Slice/Dataset out of a list of elements.

◆ select() [2/5]

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select ( const HyperSlab & hyperslab) const
inline

Select an hyperslab in the current Slice/Dataset.

HyperSlabs can be either regular or irregular. Irregular hyperslabs are typically generated by taking the union of regular hyperslabs. An irregular hyperslab, in general, does not fit nicely into a multi-dimensional array, but only a subset of such an array.

Therefore, the only memspaces supported for general hyperslabs are one-dimensional arrays.

◆ select() [3/5]

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select ( const HyperSlab & hyperslab,
const DataSpace & memspace ) const
inline

Select an hyperslab in the current Slice/Dataset.

If the selection can be read into a simple, multi-dimensional dataspace, then this overload enable specifying the shape of the memory dataspace with memspace. Note, that simple implies no offsets, strides or number of blocks, just the size of the block in each dimension.

◆ select() [4/5]

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select ( const std::vector< size_t > & columns) const
inline

Select a set of columns in the last dimension of this dataset.

The column indices must be smaller than the dimension size.

◆ select() [5/5]

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select ( const std::vector< size_t > & offset,
const std::vector< size_t > & count,
const std::vector< size_t > & stride = {},
const std::vector< size_t > & block = {} ) const
inline

Select a region in the current Slice/Dataset of count points at offset separated by stride. If strides are not provided they will default to 1 in all dimensions.

vector offset and count have to be from the same dimension

◆ write()

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::write ( const T & buffer,
const DataTransferProps & xfer_props = DataTransferProps() )
inline

Write the integrality N-dimension buffer to this dataset An exception is raised is if the numbers of dimension of the buffer and of the dataset are different

The array type can be a N-pointer or a N-vector ( e.g int** integer two dimensional array )

◆ write_raw() [1/2]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::write_raw ( const T * buffer,
const DataTransferProps & xfer_props = DataTransferProps() )
inline

Write from a raw pointer into this dataset.

Same as write_raw(const T*, const DataTransferProps&). However, this overload attempts to guess the data type of buffer, i.e. the memory datatype. Note that the file datatype is already fixed.

◆ write_raw() [2/2]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::write_raw ( const T * buffer,
const DataType & mem_datatype,
const DataTransferProps & xfer_props = DataTransferProps() )
inline

Write from a raw pointer into this dataset.

No dimensionality checks will be performed, it is the user's responsibility to ensure that the buffer holds the right amount of elements. For n-dimensional matrices the buffer layout follows H5 default conventions.

Note, this is the shallowest wrapper around H5Dwrite and should be used if full control is needed. Generally prefer write.

Parameters
bufferA buffer containing the data to be written
dtypeThe datatype of buffer, i.e. the memory data type.
xfer_propsThe HDF5 data transfer properties, e.g. collective MPI-IO.

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