HighFive 2.10.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
HighFive::DataSet Class Reference

Class representing a dataset. More...

#include <H5DataSet.hpp>

Inheritance diagram for HighFive::DataSet:
Collaboration diagram for HighFive::DataSet:

Public Member Functions

uint64_t getStorageSize () const
 getStorageSize
 
uint64_t getOffset () const
 getOffset
 
DataType getDataType () const
 getDataType
 
DataSpace getSpace () const
 getSpace
 
DataSpace getMemSpace () const
 getMemSpace
 
void resize (const std::vector< size_t > &dims)
 Change the size of the dataset.
 
std::vector< size_t > getDimensions () const
 Get the dimensions of the whole DataSet. This is a shorthand for getSpace().getDimensions()
 
size_t getElementCount () const
 Get the total number of elements in the current dataset. E.g. 2x2x2 matrix has size 8. This is a shorthand for getSpace().getTotalCount()
 
DataSetCreateProps getCreatePropertyList () const
 Get the list of properties for creation of this dataset.
 
DataSetAccessProps getAccessPropertyList () const
 Get the list of properties for accession of this dataset.
 
 DataSet ()=default
 
- Public Member Functions inherited from HighFive::Object
 Object (Object &&other) noexcept
 
 ~Object ()
 
bool isValid () const noexcept
 isValid
 
hid_t getId () const noexcept
 getId
 
ObjectInfo getInfo () const
 Retrieve several infos about the current object (address, dates, etc)
 
ObjectType getType () const
 Gets the fundamental type of the object (dataset, group, etc)
 
bool operator== (const Object &other) const noexcept
 
- Public Member Functions inherited from HighFive::SliceTraits< DataSet >
Selection select (const HyperSlab &hyperslab) const
 Select an hyperslab in the current Slice/Dataset.
 
Selection select (const HyperSlab &hyperslab, const DataSpace &memspace) const
 Select an hyperslab in the current Slice/Dataset.
 
Selection select (const std::vector< size_t > &offset, const std::vector< size_t > &count, const std::vector< size_t > &stride={}, const std::vector< size_t > &block={}) const
 Select a region in the current Slice/Dataset of count points at offset separated by stride. If strides are not provided they will default to 1 in all dimensions.
 
Selection select (const std::vector< size_t > &columns) const
 Select a set of columns in the last dimension of this dataset.
 
Selection select (const ElementSet &elements) const
 Select a region in the current Slice/Dataset out of a list of elements.
 
read (const DataTransferProps &xfer_props=DataTransferProps()) const
 
void read (T &array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
void read (T *array, const DataType &dtype, const DataTransferProps &xfer_props=DataTransferProps()) const
 
void read (T *array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
void read_raw (T *array, const DataType &dtype, const DataTransferProps &xfer_props=DataTransferProps()) const
 
void read_raw (T *array, const DataTransferProps &xfer_props=DataTransferProps()) const
 
void write (const T &buffer, const DataTransferProps &xfer_props=DataTransferProps())
 
void write_raw (const T *buffer, const DataType &mem_datatype, const DataTransferProps &xfer_props=DataTransferProps())
 
void write_raw (const T *buffer, const DataTransferProps &xfer_props=DataTransferProps())
 
- Public Member Functions inherited from HighFive::AnnotateTraits< DataSet >
Attribute createAttribute (const std::string &attribute_name, const DataSpace &space, const DataType &type)
 create a new attribute with the name attribute_name
 
Attribute createAttribute (const std::string &attribute_name, const DataSpace &space)
 createAttribute create a new attribute on the current dataset with size specified by space
 
Attribute createAttribute (const std::string &attribute_name, const T &data)
 createAttribute create a new attribute on the current dataset and write to it, inferring the DataSpace from data.
 
void deleteAttribute (const std::string &attribute_name)
 deleteAttribute let you delete an attribute by its name.
 
Attribute getAttribute (const std::string &attribute_name) const
 open an existing attribute with the name attribute_name
 
size_t getNumberAttributes () const
 return the number of attributes of the node / group
 
std::vector< std::string > listAttributeNames () const
 list all attribute name of the node / group
 
bool hasAttribute (const std::string &attr_name) const
 checks an attribute exists
 
- Public Member Functions inherited from HighFive::PathTraits< DataSet >
 PathTraits ()
 
std::string getPath () const
 return the path to the current object
 
FilegetFile () const noexcept
 Return a reference to the File object this object belongs.
 

Static Public Attributes

static const ObjectType type = ObjectType::Dataset
 

Protected Member Functions

 DataSet (Object &&o) noexcept
 
 Object (Object &&other) noexcept
 
 Object ()
 
 Object (const Object &other)
 
 Object (hid_t)
 
- Protected Member Functions inherited from HighFive::Object
 Object ()
 
 Object (const Object &other)
 
 Object (hid_t)
 
Objectoperator= (const Object &other)
 

Friends

class Reference
 
template<typename Derivate >
class NodeTraits
 

Additional Inherited Members

- Protected Attributes inherited from HighFive::Object
hid_t _hid
 
- Protected Attributes inherited from HighFive::PathTraits< DataSet >
std::shared_ptr< File_file_obj
 

Detailed Description

Class representing a dataset.

Constructor & Destructor Documentation

◆ DataSet() [1/2]

HighFive::DataSet::DataSet ( )
default
Deprecated
Default constructor creates unsafe uninitialized objects

◆ DataSet() [2/2]

HighFive::DataSet::DataSet ( Object && o)
inlineprotectednoexcept

Member Function Documentation

◆ getAccessPropertyList()

DataSetAccessProps HighFive::DataSet::getAccessPropertyList ( ) const
inline

Get the list of properties for accession of this dataset.

◆ getCreatePropertyList()

DataSetCreateProps HighFive::DataSet::getCreatePropertyList ( ) const
inline

Get the list of properties for creation of this dataset.

◆ getDataType()

DataType HighFive::DataSet::getDataType ( ) const
inline

getDataType

Returns
return the datatype associated with this dataset

◆ getDimensions()

std::vector< size_t > HighFive::DataSet::getDimensions ( ) const
inline

Get the dimensions of the whole DataSet. This is a shorthand for getSpace().getDimensions()

Returns
The shape of the current HighFive::DataSet

◆ getElementCount()

size_t HighFive::DataSet::getElementCount ( ) const
inline

Get the total number of elements in the current dataset. E.g. 2x2x2 matrix has size 8. This is a shorthand for getSpace().getTotalCount()

Returns
The shape of the current HighFive::DataSet

◆ getMemSpace()

DataSpace HighFive::DataSet::getMemSpace ( ) const
inline

getMemSpace

Returns
same than getSpace for DataSet, compatibility with Selection class

◆ getOffset()

uint64_t HighFive::DataSet::getOffset ( ) const
inline

getOffset

Returns
returns DataSet address in file

◆ getSpace()

DataSpace HighFive::DataSet::getSpace ( ) const
inline

getSpace

Returns
return the dataspace associated with this dataset

◆ getStorageSize()

uint64_t HighFive::DataSet::getStorageSize ( ) const
inline

getStorageSize

Returns
returns the amount of storage allocated for a dataset.

◆ Object() [1/4]

HighFive::Object::Object ( )
inlineprotected

◆ Object() [2/4]

HighFive::Object::Object ( const Object & other)
inlineprotected

◆ Object() [3/4]

HighFive::Object::Object ( hid_t hid)
inlineexplicitprotected

◆ Object() [4/4]

HighFive::Object::Object ( Object && other)
inlineprotectednoexcept

◆ resize()

void HighFive::DataSet::resize ( const std::vector< size_t > & dims)
inline

Change the size of the dataset.

This requires that the dataset was created with chunking, and you would generally want to have set a larger maxdims setting

Parameters
dimsNew size of the dataset

Friends And Related Symbol Documentation

◆ NodeTraits

template<typename Derivate >
friend class NodeTraits
friend

◆ Reference

friend class Reference
friend

Member Data Documentation

◆ type

const ObjectType HighFive::DataSet::type = ObjectType::Dataset
static

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