h5cpp  0.5.1
A modern C++ wrapper for the HDF5 C library
hdf5::ArrayAdapter< T > Class Template Reference

adapter for C-style arrays More...

#include <array_adapter.hpp>

Public Member Functions

 ArrayAdapter ()
 default constructor More...
 
 ArrayAdapter (T *data, size_t size)
 constructor More...
 
 ArrayAdapter (const ArrayAdapter< T > &adapter)
 copy constructor More...
 
 ArrayAdapter (ArrayAdapter< T > &&adapter)
 move constructor More...
 
ArrayAdapter< T > & operator= (const ArrayAdapter< T > &adapter)
 copy assignment More...
 
ArrayAdapter< T > & operator= (ArrayAdapter< T > &&adapter)
 move assignment More...
 
size_t size () const noexcept
 
T * data () noexcept
 
const T * data () const noexcept
 

Detailed Description

template<typename T>
class hdf5::ArrayAdapter< T >

In order to work read or write data from and to C-style arrays a special adapter is required. A native C-array does not carry all the information required to construct a dataspace for HDF5 IO. It lacks the size information. A dataspace and a datatype trait exist for this adapter template.

double *data = new double[100];
T * data() noexcept
Definition: array_adapter.hpp:120

The ArrayAdapter<T> template does not hold ownership of the array it references. So all resource management has to be done by the calling instance.

Template Parameters
Tdata type of the pointer

Constructor & Destructor Documentation

◆ ArrayAdapter() [1/4]

template<typename T >
hdf5::ArrayAdapter< T >::ArrayAdapter ( )
inline

◆ ArrayAdapter() [2/4]

template<typename T >
hdf5::ArrayAdapter< T >::ArrayAdapter ( T *  data,
size_t  size 
)
inline
Parameters
datapointer to the data data to which to read or write data
sizenumber of elements referenced by the pointer

◆ ArrayAdapter() [3/4]

template<typename T >
hdf5::ArrayAdapter< T >::ArrayAdapter ( const ArrayAdapter< T > &  adapter)

◆ ArrayAdapter() [4/4]

template<typename T >
hdf5::ArrayAdapter< T >::ArrayAdapter ( ArrayAdapter< T > &&  adapter)

Member Function Documentation

◆ data() [1/2]

template<typename T >
const T* hdf5::ArrayAdapter< T >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename T >
T* hdf5::ArrayAdapter< T >::data ( )
inlinenoexcept

◆ operator=() [1/2]

template<typename T >
ArrayAdapter< T > & hdf5::ArrayAdapter< T >::operator= ( ArrayAdapter< T > &&  adapter)

◆ operator=() [2/2]

template<typename T >
ArrayAdapter< T > & hdf5::ArrayAdapter< T >::operator= ( const ArrayAdapter< T > &  adapter)

◆ size()

template<typename T >
size_t hdf5::ArrayAdapter< T >::size ( ) const
inlinenoexcept

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