Dataset Class Reference#

DiFfRG: DiFfRG::hdf5::Dataset Class Reference
DiFfRG

#include <dataset.hh>

Public Member Functions

 Dataset ()=default
 
 Dataset (hid_t id)
 
hid_t id () const noexcept
 
bool valid () const noexcept
 
Datatype datatype () const
 
Dataspace dataspace () const
 
void resize (const Dims &dims)
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void write (const T &value)
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void write_at (hsize_t offset, const T &value)
 
void write_at (hsize_t offset, const std::string &value)
 Variable-length string write into a 1-element selection.
 
void write (const std::string &value)
 Whole-dataset write of a single string.
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void write (const std::vector< T > &v)
 Vector write — element count must match the dataset's element count.
 
void write (const std::vector< std::string > &v)
 Vector of strings.
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void write (const T *data, std::size_t)
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void read (T &value)
 
void read (std::string &value)
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void read (std::vector< T > &v)
 
void read (std::vector< std::string > &v)
 
template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void read (T *data, std::size_t)
 

Static Public Member Functions

static Dataset take (hid_t id)
 

Private Member Functions

 Dataset (Handle h)
 

Private Attributes

Handle h_
 

Constructor & Destructor Documentation

◆ Dataset() [1/3]

DiFfRG::hdf5::Dataset::Dataset ( )
default

◆ Dataset() [2/3]

DiFfRG::hdf5::Dataset::Dataset ( hid_t id)
inlineexplicit

◆ Dataset() [3/3]

DiFfRG::hdf5::Dataset::Dataset ( Handle h)
inlineexplicitprivate

Member Function Documentation

◆ dataspace()

Dataspace DiFfRG::hdf5::Dataset::dataspace ( ) const
inline

◆ datatype()

Datatype DiFfRG::hdf5::Dataset::datatype ( ) const
inline

◆ id()

hid_t DiFfRG::hdf5::Dataset::id ( ) const
inlinenoexcept

◆ read() [1/5]

void DiFfRG::hdf5::Dataset::read ( std::string & value)
inline

◆ read() [2/5]

void DiFfRG::hdf5::Dataset::read ( std::vector< std::string > & v)
inline

◆ read() [3/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::read ( std::vector< T > & v)
inline

◆ read() [4/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::read ( T & value)
inline

◆ read() [5/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::read ( T * data,
std::size_t  )
inline

◆ resize()

void DiFfRG::hdf5::Dataset::resize ( const Dims & dims)
inline

◆ take()

static Dataset DiFfRG::hdf5::Dataset::take ( hid_t id)
inlinestatic

◆ valid()

bool DiFfRG::hdf5::Dataset::valid ( ) const
inlinenoexcept

◆ write() [1/5]

void DiFfRG::hdf5::Dataset::write ( const std::string & value)
inline

Whole-dataset write of a single string.

◆ write() [2/5]

void DiFfRG::hdf5::Dataset::write ( const std::vector< std::string > & v)
inline

Vector of strings.

◆ write() [3/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::write ( const std::vector< T > & v)
inline

Vector write — element count must match the dataset's element count.

◆ write() [4/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::write ( const T & value)
inline

Write a single value into the dataset's full extent (must currently be shaped as a scalar OR a single-element simple space).

◆ write() [5/5]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::write ( const T * data,
std::size_t  )
inline

Raw-pointer write — covers the (former) ArrayAdapter path. The caller promises that the buffer holds n T elements that match the dataset's selected element count.

◆ write_at() [1/2]

void DiFfRG::hdf5::Dataset::write_at ( hsize_t offset,
const std::string & value )
inline

Variable-length string write into a 1-element selection.

◆ write_at() [2/2]

template<class T >
requires (!std::is_same_v<std::decay_t<T>, std::string>)
void DiFfRG::hdf5::Dataset::write_at ( hsize_t offset,
const T & value )
inline

Write a single value into the element selected by [offset, offset+1). This is the "append to chunked unlimited" pattern. Caller is responsible for resizing the dataset first.

Member Data Documentation

◆ h_

Handle DiFfRG::hdf5::Dataset::h_
private

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/hdf5lib/dataset.hh