h5cpp
0.6
A modern C++ wrapper for the HDF5 C library
|
hyperslab selection class More...
#include <hyperslab.hpp>
Public Member Functions | |
Hyperslab () | |
default constructor More... | |
~Hyperslab () override | |
destructor More... | |
Hyperslab (const Hyperslab &)=default | |
copy constructor More... | |
Hyperslab (size_t rank) | |
constructor More... | |
Hyperslab (const Dimensions &offset, const Dimensions &block, const Dimensions &count, const Dimensions &stride) | |
constructor More... | |
Hyperslab (const Dimensions &offset, const Dimensions &block) | |
constructor More... | |
Hyperslab (const Dimensions &offset, const Dimensions &count, const Dimensions &stride) | |
constructor More... | |
size_t | rank () const noexcept |
get rank More... | |
void | offset (size_t index, size_t value) |
set start value for a dimension More... | |
void | offset (const Dimensions &values) |
set all start values More... | |
const Dimensions & | offset () const |
get start values More... | |
void | stride (size_t index, size_t value) |
set stride value for an individual dimension More... | |
void | stride (const Dimensions &values) |
set all stride values for the Hyperslab More... | |
const Dimensions & | stride () const |
get stride values for the Hyperslab More... | |
void | count (size_t index, size_t value) |
set count value for a particular dimension More... | |
void | count (const Dimensions &values) |
set all count values More... | |
const Dimensions & | count () const |
get count values More... | |
void | block (size_t index, size_t value) |
set block size for dimension More... | |
void | block (const Dimensions &values) |
set all block values More... | |
const Dimensions & | block () const |
get block values More... | |
virtual void | apply (const Dataspace &space, SelectionOperation ops) const override |
apply a selection onto a dataspace More... | |
virtual Dimensions | dimensions () const override |
get current dimensions More... | |
virtual size_t | size () const override |
get the selection size More... | |
virtual SelectionType | type () const override |
get the selection type More... | |
Public Member Functions inherited from hdf5::dataspace::Selection | |
Selection ()=default | |
default constructor More... | |
Selection (const Selection &)=default | |
copy constructor More... | |
virtual | ~Selection () |
destructor More... | |
Additional Inherited Members | |
Public Types inherited from hdf5::dataspace::Selection | |
using | UniquePointer = std::unique_ptr< Selection > |
pointer for selection stacks More... | |
using | SharedPointer = std::shared_ptr< Selection > |
Hyperslabs represent complex multidimensional selections within an HDF5 dataset. The number of dimensions for every hyperslab is determined during construction and cannot be altered once it has been fixed.
Todo:
hdf5::dataspace::Hyperslab::Hyperslab | ( | ) |
The default constructor is present to allow Hyperslabs in STL containers. It must be noted that any attempt to change an internal value will result in a std::runtime_error exception. The rank of a default constructed Hyperslab would be 0. As a Hyperslab of rank 0 would not make any sense one could use this to identify a default constructed Hyperslab.
|
override |
|
default |
Use compiler generated default implementation here
hdf5::dataspace::Hyperslab::Hyperslab | ( | size_t | rank | ) |
Construct a Hyperslab selection of a given rank.
rank | the number of dimensions |
hdf5::dataspace::Hyperslab::Hyperslab | ( | const Dimensions & | offset, |
const Dimensions & | block, | ||
const Dimensions & | count, | ||
const Dimensions & | stride | ||
) |
This constructor exposes the full capabilities of a hyperslab. All parameters can be adjusted.
offset | the offset from which to start the selection |
block | the size of a single block in the selection |
count | the number of blocks along each dimensions |
stride | the stride along each dimension between the blocks |
hdf5::dataspace::Hyperslab::Hyperslab | ( | const Dimensions & | offset, |
const Dimensions & | block | ||
) |
Construct a hyperslab which constists of a single block starting at a particular offset.
offset | the start offset of the block |
block | the size of the single block |
hdf5::dataspace::Hyperslab::Hyperslab | ( | const Dimensions & | offset, |
const Dimensions & | count, | ||
const Dimensions & | stride | ||
) |
Construct a hyperslab which consists of count
blocks of size 1 along each dimension separated by stride
elements.
offset | starting offset of the selection |
count | number of blocks along each dimensions |
stride | the stride between the blocks along each dimension |
|
overridevirtual |
The current selection will be applied to dataspace space
using the operator determined by ops
.
std::runtime_error | in case of a failure |
space | reference to the dataspace onto which to apply the selection |
ops | operator for the selection |
Implements hdf5::dataspace::Selection.
const Dimensions& hdf5::dataspace::Hyperslab::block | ( | ) | const |
Get a const reference to the block values of the hyperslab.
std::runtime_error | in case of a failure |
void hdf5::dataspace::Hyperslab::block | ( | const Dimensions & | values | ) |
Set all block values for the hyperslab selection.
std::runtime_error | in case of a failure |
values | reference to the new block values |
void hdf5::dataspace::Hyperslab::block | ( | size_t | index, |
size_t | value | ||
) |
std::runtime_error | in case of a failure |
index | dimension index |
value | the new block size for this dimension |
const Dimensions& hdf5::dataspace::Hyperslab::count | ( | ) | const |
Return a const reference to the count values of the Hypeslab. The values cannot be changed via this reference.
std::runtime_error | in case of a failure |
void hdf5::dataspace::Hyperslab::count | ( | const Dimensions & | values | ) |
std::runtime_error | in case of a failure |
values | reference to the new count values |
void hdf5::dataspace::Hyperslab::count | ( | size_t | index, |
size_t | value | ||
) |
std::runtime_error | in case of a failure |
index | dimension index |
value | new count value for this dimension |
|
overridevirtual |
Get a number of elements along each dimension a selection spans this is particularly useful in the case of a Hyperslab
std::runtime_error | in case of a failure |
Implements hdf5::dataspace::Selection.
const Dimensions& hdf5::dataspace::Hyperslab::offset | ( | ) | const |
std::runtime_error | if the Hyperslab is default constructed |
void hdf5::dataspace::Hyperslab::offset | ( | const Dimensions & | values | ) |
Set the start values for all dimensions of the hyperslab. If the size of values
exceeds the rank of the hyperslab an exception will be thrown.
std::runtime_error | in case of a failure |
values | new start values for the hyperslab |
void hdf5::dataspace::Hyperslab::offset | ( | size_t | index, |
size_t | value | ||
) |
Set the start value of the hyperslab for a particular dimension determined by index
to value
. This method throws an exception if the dimension index
exceeds the rank of the hyperslab.
std::runtime_error | in case of a failure |
index | dimension index |
value | new start value |
|
noexcept |
|
overridevirtual |
Get the total number of elements adressed by an individual selection
std::runtime_error | in case of a failure |
Implements hdf5::dataspace::Selection.
const Dimensions& hdf5::dataspace::Hyperslab::stride | ( | ) | const |
std::runtime_error | in case of a failure |
void hdf5::dataspace::Hyperslab::stride | ( | const Dimensions & | values | ) |
std::runtime_error | in case of a failure |
values | new stride values for the Hyperslab |
void hdf5::dataspace::Hyperslab::stride | ( | size_t | index, |
size_t | value | ||
) |
std::runtime_error | in case of a failure |
index | dimension index for which to set the stride |
value | new stride value |
|
overridevirtual |
Get the type of the selection
Implements hdf5::dataspace::Selection.