MDAL
Public Types | Public Member Functions | Protected Attributes | List of all members
HdfDataset Class Reference

Public Types

typedef HdfH< H5I_DATASET > Handle
 

Public Member Functions

 HdfDataset ()=default
 creates invalid dataset
 
 HdfDataset (hid_t file, const std::string &path, HdfDataType dtype, size_t nItems=1)
 Creates new, simple 1 dimensional dataset.
 
 HdfDataset (hid_t file, const std::string &path, HdfDataType dtype, HdfDataspace dataspace)
 Creates new dataset with custom dimensions.
 
 HdfDataset (hid_t file, const std::string &path)
 Opens dataset for reading.
 
bool isValid () const
 
hid_t id () const
 
std::vector< hsize_t > dims () const
 
hsize_t elementCount () const
 
H5T_class_t type () const
 
std::vector< uchar > readArrayUint8 () const
 Reads full array into vector Array can have any number of dimenstions and it is fully read into 1D vector.
 
std::vector< float > readArray () const
 
std::vector< double > readArrayDouble () const
 
std::vector< int > readArrayInt () const
 
std::vector< std::string > readArrayString () const
 
std::vector< uchar > readArrayUint8 (const std::vector< hsize_t > offsets, const std::vector< hsize_t > counts) const
 Reads part of the N-D array into vector, for each dimension specified by offset and count size of offsets and counts must be same as rank (number of dims) of dataset the results array is 1D.
 
std::vector< float > readArray (const std::vector< hsize_t > offsets, const std::vector< hsize_t > counts) const
 
std::vector< double > readArrayDouble (const std::vector< hsize_t > offsets, const std::vector< hsize_t > counts) const
 
std::vector< int > readArrayInt (const std::vector< hsize_t > offsets, const std::vector< hsize_t > counts) const
 
bool hasAttribute (const std::string &attr_name) const
 
HdfAttribute attribute (const std::string &attr_name) const
 
template<typename T >
std::vector< T > readArray (hid_t mem_type_id) const
 
template<typename T >
std::vector< T > readArray (hid_t mem_type_id, const std::vector< hsize_t > offsets, const std::vector< hsize_t > counts) const
 
float readFloat () const
 Reads float value.
 
std::string readString () const
 Reads string value.
 
void write (const std::string &value)
 Writes string dataset with single entry.
 
void write (std::vector< float > &value)
 Writes array of float data.
 
void write (float value)
 
void write (std::vector< double > &value)
 Writes array of double data.
 

Protected Attributes

std::shared_ptr< Handled
 
HdfDataType mType
 

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