h5cpp  0.6
A modern C++ wrapper for the HDF5 C library
hdf5::dataspace::View Class Reference

guard object for selections More...

#include <view.hpp>

Public Member Functions

 View ()=default
 default constructor More...
 
 View (const View &)=default
 copy constructor More...
 
 View (const Dataspace &space)
 constructor More...
 
 View (const Dataspace &space, const SelectionList &selections)
 constructor More...
 
 View (const Dataspace &space, const Hyperslab &selection)
 constructor More...
 
void operator() (const SelectionList &selections) const
 apply a new set of selections More...
 
void operator() (const Hyperslab &slab) const
 set a single hyperslab More...
 
size_t size () const
 get number of elements in the view More...
 
 operator hid_t () const
 

Detailed Description

The View class applies selections on a dataspace. Since a copy of the original dataspace is created the former one remains unchanged.

Constructor & Destructor Documentation

◆ View() [1/5]

hdf5::dataspace::View::View ( )
default

Need this for STL container compatibility. Can rely on default implementation provided by the compiler.

◆ View() [2/5]

hdf5::dataspace::View::View ( const View )
default

Need this for STL container compatibility. Use the default implementation provided by the compiler.

◆ View() [3/5]

hdf5::dataspace::View::View ( const Dataspace space)
explicit

This constructor applies now selection but selects all elements in the dataspace.

Exceptions
std::runtime_errorin the case of a failure
Parameters
spacereference to the original dataspace

◆ View() [4/5]

hdf5::dataspace::View::View ( const Dataspace space,
const SelectionList selections 
)

Creates a copy of the dataspace and applies all selections provieed by th selection list to this copy.

Exceptions
std::runtime_errorin case of a failure
Parameters
spacereference to the original dataspace
selectionsreference to the list of selections to apply

◆ View() [5/5]

hdf5::dataspace::View::View ( const Dataspace space,
const Hyperslab selection 
)

Creates a copy of the dataspace and applies a single hyperslab on it. This is a conveniance constructor in the case that we need only a single hyperslab.

Exceptions
std::runtime_errorin case of a failure
Parameters
spacereference to the original dataspace
selectionreference to the original hyperslab

Member Function Documentation

◆ operator hid_t()

hdf5::dataspace::View::operator hid_t ( ) const
inlineexplicit

◆ operator()() [1/2]

void hdf5::dataspace::View::operator() ( const Hyperslab slab) const

This is a mere convienance function for situations where a single Hyperslab should be selected. This even might be the most common case at all.

Exceptions
std::runtime_errorin case of a failure
Parameters
slabreference to the hyperslab

◆ operator()() [2/2]

void hdf5::dataspace::View::operator() ( const SelectionList selections) const

Calling this operator will erase all current selections and replace them by the new set of selections provided by the selections argument.

Exceptions
std::runtime_error

◆ size()

size_t hdf5::dataspace::View::size ( ) const

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