HighFive 2.7.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 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=DataType(), 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 &dtype=DataType(), const DataTransferProps &xfer_props=DataTransferProps())
 

Protected Member Functions

Selection select_impl (const HyperSlab &hyperslab, const DataSpace &memspace) const
 

Member Function Documentation

◆ read() [1/3]

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

◆ read() [2/3]

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/3]

template<typename Derivate >
template<typename T >
void HighFive::SliceTraits< Derivate >::read ( T *  array,
const DataType dtype = DataType(),
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/4]

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/4]

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/4]

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() [4/4]

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

◆ select_impl()

template<typename Derivate >
Selection HighFive::SliceTraits< Derivate >::select_impl ( const HyperSlab hyperslab,
const DataSpace memspace 
) const
inlineprotected

◆ 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()

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

Write from a raw buffer 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.

Parameters
bufferA buffer containing the data to be written
dtypeThe type of the data, in case it cannot be automatically guessed
xfer_propsThe HDF5 data transfer properties, e.g. collective MPI-IO.

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