Fesapi 2.9.0.1
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
eml2::AbstractHdfProxy Class Referenceabstract

An abstract proxy for reading and writing values into an HDF5 file. It is possible to derive this class in a custom class in order for the FESAPI user to get change the FESAPI reads from and writes to HDF5 file. However, please note that the RESQML standard mandates so far a HDF5 1.8 backward compatibility. In ordre to achieve this backward compatibility please use hid_t access_props = H5Pcreate (H5P_FILE_ACCESS); H5Pset_libver_bounds (access_props, H5F_LIBVER_V18, H5F_LIBVER_V18); when you create an HDF5 file before to write into it. See https://confluence.hdfgroup.org/display/HDF5/H5P_SET_LIBVER_BOUNDS for more details. More...

#include <AbstractHdfProxy.h>

Inheritance diagram for eml2::AbstractHdfProxy:
eml2::EpcExternalPartReference eml2::HdfProxy

Public Member Functions

virtual ~AbstractHdfProxy ()=default
 
void setRootPath (const std::string &rootPath)
 
void setRelativePath (const std::string &relPath)
 
void setOpeningMode (common ::DataObjectRepository::openingMode openingMode_)
 
const std::string & getRelativePath () const
 
virtual void open ()=0
 
virtual bool isOpened () const =0
 
virtual void close ()=0
 
virtual common::AbstractObject::numericalDatatypeEnum getNumericalDatatype (const std::string &datasetName)=0
 
virtual int getHdfDatatypeClassInDataset (const std::string &datasetName)=0
 
virtual void writeItemizedListOfList (const std::string &groupName, const std::string &name, common ::AbstractObject::numericalDatatypeEnum cumulativeLengthDatatype, const void *cumulativeLength, uint64_t cumulativeLengthSize, common ::AbstractObject::numericalDatatypeEnum elementsDatatype, const void *elements, uint64_t elementsSize)=0
 
uint64_t getDimensionCount (const std::string &datasetName)
 
virtual std::vector< uint32_t > getElementCountPerDimension (const std::string &datasetName)=0
 
uint64_t getElementCount (const std::string &datasetName)
 
virtual void setCompressionLevel (unsigned int newCompressionLevel)=0
 
void writeArrayNdOfFloatValues (const std::string &groupName, const std::string &name, const float *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
void writeArrayNdOfDoubleValues (const std::string &groupName, const std::string &name, const double *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
void writeArrayNdOfInt8Values (const std::string &groupName, const std::string &name, const int8_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
void writeArrayNdOfIntValues (const std::string &groupName, const std::string &name, const int *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
void writeArrayNdOfInt64Values (const std::string &groupName, const std::string &name, const int64_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
void writeArrayNdOfUInt64Values (const std::string &groupName, const std::string &name, const uint64_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
 
virtual void writeArrayNd (const std::string &groupName, const std::string &name, common ::AbstractObject::numericalDatatypeEnum datatype, const void *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)=0
 
virtual void createArrayNd (const std::string &groupName, const std::string &name, common ::AbstractObject::numericalDatatypeEnum datatype, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)=0
 
virtual void writeArrayNdSlab (const std::string &groupName, const std::string &name, common ::AbstractObject::numericalDatatypeEnum datatype, const void *values, const uint64_t *numValuesInEachDimension, const uint64_t *offsetValuesInEachDimension, unsigned int numDimensions)=0
 
virtual void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)=0
 
virtual void writeGroupAttribute (const std::string &groupName, const std::string &attributeName, const std::vector< std::string > &values)=0
 
virtual void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)=0
 
virtual void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)=0
 
virtual void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)=0
 
virtual void writeDatasetAttribute (const std::string &datasetName, const std::string &attributeName, const std::vector< std::string > &values)=0
 
virtual void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)=0
 
virtual void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)=0
 
virtual std::string readStringAttribute (const std::string &obj_name, const std::string &attr_name) const =0
 
virtual std::vector< std::string > readStringArrayAttribute (const std::string &obj_name, const std::string &attr_name) const =0
 
virtual double readDoubleAttribute (const std::string &obj_name, const std::string &attr_name) const =0
 
virtual int64_t readInt64Attribute (const std::string &obj_name, const std::string &attr_name) const =0
 
virtual void readArrayNdOfDoubleValues (const std::string &datasetName, double *values)=0
 
virtual void readArrayNdOfDoubleValues (const std::string &datasetName, double *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
 
virtual void readArrayNdOfDoubleValues (const std::string &datasetName, double *values, uint64_t const *blockCountPerDimension, uint64_t const *offsetInEachDimension, uint64_t const *strideInEachDimension, uint64_t const *blockSizeInEachDimension, unsigned int numDimensions)=0
 
virtual void selectArrayNdOfValues (const std::string &datasetName, uint64_t const *blockCountPerDimension, uint64_t const *offsetInEachDimension, uint64_t const *strideInEachDimension, uint64_t const *blockSizeInEachDimension, unsigned int numDimensions, bool newSelection, hdf5_hid_t &dataset, hdf5_hid_t &filespace)=0
 
virtual void readArrayNdOfDoubleValues (hdf5_hid_t dataset, hdf5_hid_t filespace, void *values, uint64_t slabSize)=0
 
virtual void readArrayNdOfFloatValues (const std::string &datasetName, float *values)=0
 
virtual void readArrayNdOfFloatValues (const std::string &datasetName, float *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
 
virtual void readArrayNdOfInt64Values (const std::string &datasetName, int64_t *values)=0
 
virtual void readArrayNdOfInt64Values (const std::string &datasetName, int64_t *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
 
virtual void readArrayNdOfUInt64Values (const std::string &datasetName, uint64_t *values)=0
 
virtual void readArrayNdOfIntValues (const std::string &datasetName, int *values)=0
 
virtual void readArrayNdOfIntValues (const std::string &datasetName, int *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
 
virtual void readArrayNdOfUIntValues (const std::string &datasetName, unsigned int *values)=0
 
virtual void readArrayNdOfShortValues (const std::string &datasetName, short *values)=0
 
virtual void readArrayNdOfUShortValues (const std::string &datasetName, unsigned short *values)=0
 
virtual void readArrayNdOfInt8Values (const std::string &datasetName, int8_t *values)=0
 
virtual void readArrayNdOfUInt8Values (const std::string &datasetName, uint8_t *values)=0
 
virtual bool exist (const std::string &absolutePathInHdfFile) const =0
 
virtual bool isCompressed (const std::string &datasetName)=0
 
void setMaxChunkSize (unsigned int newMaxChunkSize)
 
virtual std::vector< uint32_t > getElementCountPerChunkDimension (const std::string &datasetName)=0
 
void initGsoapProxy (common ::DataObjectRepository *repo, const std::string &guid, const std::string &title, unsigned int emlVersion)
 
- Public Member Functions inherited from eml2::EpcExternalPartReference
virtual ~EpcExternalPartReference ()=default
 
virtual std::string getXmlTag () const final
 

Static Public Attributes

static constexpr char const * CUMULATIVE_LENGTH_DS_NAME = "cumulativeLength"
 
static constexpr char const * ELEMENTS_DS_NAME = "elements"
 
static constexpr char const * MIME_TYPE = "application/x-hdf5"
 
- Static Public Attributes inherited from eml2::EpcExternalPartReference
static constexpr char const * XML_TAG = "EpcExternalPartReference"
 

Detailed Description

An abstract proxy for reading and writing values into an HDF5 file. It is possible to derive this class in a custom class in order for the FESAPI user to get change the FESAPI reads from and writes to HDF5 file. However, please note that the RESQML standard mandates so far a HDF5 1.8 backward compatibility. In ordre to achieve this backward compatibility please use hid_t access_props = H5Pcreate (H5P_FILE_ACCESS); H5Pset_libver_bounds (access_props, H5F_LIBVER_V18, H5F_LIBVER_V18); when you create an HDF5 file before to write into it. See https://confluence.hdfgroup.org/display/HDF5/H5P_SET_LIBVER_BOUNDS for more details.

Constructor & Destructor Documentation

◆ ~AbstractHdfProxy()

virtual eml2::AbstractHdfProxy::~AbstractHdfProxy ( )
virtualdefault

Destructor

Member Function Documentation

◆ close()

virtual void eml2::AbstractHdfProxy::close ( )
pure virtual

Closes the HDF5 file

Implemented in eml2::HdfProxy.

◆ createArrayNd()

virtual void eml2::AbstractHdfProxy::createArrayNd ( const std::string & groupName,
const std::string & name,
common ::AbstractObject::numericalDatatypeEnum datatype,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
pure virtual

Creates an nd array of a specific datatype into the HDF5 file by means of a single dataset. Values are not yet written to this array

Parameters
groupNameThe name of the group where to create the nd array of specific datatype values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not exist.
datatypeThe specific datatype of the nd array values.
numValuesInEachDimensionNumber of values in each dimension of the nd array. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to create.

Implemented in eml2::HdfProxy.

◆ exist()

virtual bool eml2::AbstractHdfProxy::exist ( const std::string & absolutePathInHdfFile) const
pure virtual

Checks whether an absolute path exists in the HDF5 file

Parameters
absolutePathInHdfFileAn absolute path in the HDF5 file.
Returns
True if the absolute path exists, else false.

Implemented in eml2::HdfProxy.

◆ getDimensionCount()

uint64_t eml2::AbstractHdfProxy::getDimensionCount ( const std::string & datasetName)
inline

Gets the number of dimensions in an HDF5 dataset of the proxy.

Parameters
datasetNameThe absolute name (not relative to a group) of the dataset we want to get the number of dimensions.
Returns
The number of dimensions of the dataset if successful, otherwise returns a negative value.

◆ getElementCount()

uint64_t eml2::AbstractHdfProxy::getElementCount ( const std::string & datasetName)

Gets the number of elements in an HDF5 dataset of the proxy. The number of elements is got from all dimensions.

Parameters
datasetNameThe absolute name (not relative to a group) of the dataset we want to get the number of elements.
Returns
The number of elements of the dataset

◆ getElementCountPerChunkDimension()

virtual std::vector< uint32_t > eml2::AbstractHdfProxy::getElementCountPerChunkDimension ( const std::string & datasetName)
pure virtual

Get the number of elements in each chunk dimension of an HDF5 dataset. If the dataset is not compressed, then it returns an empty vector. uint32_t is returned instead of uint64_t cause of some SWIG usage. I cannot SWIG port std::vector<uint64_t>

Parameters
datasetNameThe absolute name of the dataset which we want to get the number of elements from.

Implemented in eml2::HdfProxy.

◆ getElementCountPerDimension()

virtual std::vector< uint32_t > eml2::AbstractHdfProxy::getElementCountPerDimension ( const std::string & datasetName)
pure virtual

Get the number of elements in each dimension of an HDF5 dataset. uint32_t is returned instead of uint64_t cause of some SWIG usage. I cannot SWIG port std::vector<uint64_t>

Parameters
datasetNameThe absolute name of the dataset which we want to get the number of elements from.

Implemented in eml2::HdfProxy.

◆ getHdfDatatypeClassInDataset()

virtual int eml2::AbstractHdfProxy::getHdfDatatypeClassInDataset ( const std::string & datasetName)
pure virtual

Gets the datatype class (H5T_INTEGER, H5T_FLOAT, H5T_STRING, etc.) of a dataset

Parameters
datasetNameName of the dataset.
Returns
The HDF5 datatype class identifier if successful, otherwise H5T_NO_CLASS (-1).

Implemented in eml2::HdfProxy.

◆ getNumericalDatatype()

virtual common::AbstractObject::numericalDatatypeEnum eml2::AbstractHdfProxy::getNumericalDatatype ( const std::string & datasetName)
pure virtual

Gets the native datatype of a dataset

Parameters
datasetNameName of the dataset.
Returns
The native datatype identifier of the dataset if successful, otherwise returns unknown;

Implemented in eml2::HdfProxy.

◆ getRelativePath()

const std::string & eml2::AbstractHdfProxy::getRelativePath ( ) const
inline

Gets the relative path of the HDF5 file regarding the path of the directory containing the EPC file associated to this HDF5 file

Returns
The relative path of the HDF5 file.

◆ initGsoapProxy()

void eml2::AbstractHdfProxy::initGsoapProxy ( common ::DataObjectRepository * repo,
const std::string & guid,
const std::string & title,
unsigned int emlVersion )

Instantiate and initialize the gsoap proxy. This method is defined in order to be used in derived class without having to link to generated gsoap files. It is public in order for the user to be able to call it in other languages (C#, Java, etc.) thanks to Swig.

Parameters
[in,out]repoThe repository where the underlying gsoap proxy is going to be initialized.
guidThe guid of the underlying gsoap proxy to be initialized.
titleThe title of the underlying gsoap proxy to be initialized.
emlVersionDesired eml Version such as 20 (for v2.0) or 23 (for v2.3) etc...

◆ isCompressed()

virtual bool eml2::AbstractHdfProxy::isCompressed ( const std::string & datasetName)
pure virtual

Checks whether a dataset is compressed or not

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameName of the dataset.
Returns
True if compressed, false if not.

Implemented in eml2::HdfProxy.

◆ isOpened()

virtual bool eml2::AbstractHdfProxy::isOpened ( ) const
pure virtual

Checks if the HDF5 file is open or not

Returns
True if opened, false if not.

Implemented in eml2::HdfProxy.

◆ open()

virtual void eml2::AbstractHdfProxy::open ( )
pure virtual

Opens the HDF5 file for reading and writing. The read and write rights are determined by the EPC document configuration

Implemented in eml2::HdfProxy.

◆ readArrayNdOfDoubleValues() [1/4]

virtual void eml2::AbstractHdfProxy::readArrayNdOfDoubleValues ( const std::string & datasetName,
double * values )
pure virtual

Reads an nd array of double values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of double values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfDoubleValues() [2/4]

virtual void eml2::AbstractHdfProxy::readArrayNdOfDoubleValues ( const std::string & datasetName,
double * values,
uint64_t const * blockCountPerDimension,
uint64_t const * offsetInEachDimension,
uint64_t const * strideInEachDimension,
uint64_t const * blockSizeInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array of double values associated with datasetName and reads from it

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
[out]values1d array of double values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
blockCountPerDimensionNumber of blocks to select from the dataspace, in each dimension. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
strideInEachDimensionNumber of elements to move from one block to another in each dimension. They are ordered from fastest index to slowest index.
blockSizeInEachDimensionSize of selected blocks in each dimension. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfDoubleValues() [3/4]

virtual void eml2::AbstractHdfProxy::readArrayNdOfDoubleValues ( const std::string & datasetName,
double * values,
uint64_t const * numValuesInEachDimension,
uint64_t const * offsetInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array of double values associated with datasetName and reads from it

Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
[out]values1d array of double values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
numValuesInEachDimensionNumber of values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfDoubleValues() [4/4]

virtual void eml2::AbstractHdfProxy::readArrayNdOfDoubleValues ( hdf5_hid_t dataset,
hdf5_hid_t filespace,
void * values,
uint64_t slabSize )
pure virtual

Considering a given nd array dataset, reads the double values corresponding to an existing selected region.

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetID of the dataset to read from.
filespaceID of the selected region.
[out]values1d array of double values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
slabSizeNumber of values to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfFloatValues() [1/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfFloatValues ( const std::string & datasetName,
float * values )
pure virtual

Reads an nd array of float values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of float values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfFloatValues() [2/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfFloatValues ( const std::string & datasetName,
float * values,
uint64_t const * numValuesInEachDimension,
uint64_t const * offsetInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array of float values associated with datasetName and reads from it

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
[out]values1d array of float values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
numValuesInEachDimensionNumber of values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfInt64Values() [1/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfInt64Values ( const std::string & datasetName,
int64_t * values )
pure virtual

Reads an nd array of long values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of long values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfInt64Values() [2/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfInt64Values ( const std::string & datasetName,
int64_t * values,
uint64_t const * numValuesInEachDimension,
uint64_t const * offsetInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array of long values associated with datasetName and reads from it

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
[out]values1d array of long values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
numValuesInEachDimensionNumber of values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfInt8Values()

virtual void eml2::AbstractHdfProxy::readArrayNdOfInt8Values ( const std::string & datasetName,
int8_t * values )
pure virtual

Reads an nd array of int 8 bits values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of int 8 bits values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfIntValues() [1/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfIntValues ( const std::string & datasetName,
int * values )
pure virtual

Reads an nd array of int values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of int values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfIntValues() [2/2]

virtual void eml2::AbstractHdfProxy::readArrayNdOfIntValues ( const std::string & datasetName,
int * values,
uint64_t const * numValuesInEachDimension,
uint64_t const * offsetInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array of int values associated with datasetName and reads from it

Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
[out]values1d array of int values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.
numValuesInEachDimensionNumber of values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the nd array to read. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfShortValues()

virtual void eml2::AbstractHdfProxy::readArrayNdOfShortValues ( const std::string & datasetName,
short * values )
pure virtual

Reads an nd array of short values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of short values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfUInt64Values()

virtual void eml2::AbstractHdfProxy::readArrayNdOfUInt64Values ( const std::string & datasetName,
uint64_t * values )
pure virtual

Reads an nd array of unsigned long values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of unsigned long values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfUInt8Values()

virtual void eml2::AbstractHdfProxy::readArrayNdOfUInt8Values ( const std::string & datasetName,
uint8_t * values )
pure virtual

Reads an nd array of unsigned int 8 bits values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of unsigned int 8 bits values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfUIntValues()

virtual void eml2::AbstractHdfProxy::readArrayNdOfUIntValues ( const std::string & datasetName,
unsigned int * values )
pure virtual

Reads an nd array of unsigned int values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of unsigned int values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readArrayNdOfUShortValues()

virtual void eml2::AbstractHdfProxy::readArrayNdOfUShortValues ( const std::string & datasetName,
unsigned short * values )
pure virtual

Reads an nd array of unsigned short values stored in a specific dataset

Exceptions
std::invalid_argumentIf the nd array dataset cannot be opened or read.
Parameters
datasetNameThe absolute name of the nd array dataset.
[out]values1d array of unsigned short values ordered firstly by fastest direction. The values must be pre-allocated and won't be freed by this method.

Implemented in eml2::HdfProxy.

◆ readDoubleAttribute()

virtual double eml2::AbstractHdfProxy::readDoubleAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
pure virtual

Reads a double which is stored as an HDF5 attribute in a file, group or dataset

Exceptions
std::invalid_argumentIf the HDF5 file is not opened or if the attribute cannot be read.
Parameters
obj_nameuse "." if the attribute to read is on the file otherwise the full path of the group or dataset.
attr_nameName of the attribute.
Returns
The attribute value.

Implemented in eml2::HdfProxy.

◆ readInt64Attribute()

virtual int64_t eml2::AbstractHdfProxy::readInt64Attribute ( const std::string & obj_name,
const std::string & attr_name ) const
pure virtual

Reads a long which is stored as an HDF5 attribute in a file, group or dataset

Exceptions
std::invalid_argumentIf the HDF5 file is not opened or if the attribute cannot be read.
Parameters
obj_nameuse '.' if the attribute to read is on the file otherwise the full path of the group or dataset.
attr_nameName of the attribute.
Returns
The attribute value.

Implemented in eml2::HdfProxy.

◆ readStringArrayAttribute()

virtual std::vector< std::string > eml2::AbstractHdfProxy::readStringArrayAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
pure virtual

Reads string values which are stored as an HDF5 attribute in a file, group or dataset

Exceptions
std::invalid_argumentIf the HDF5 file is not opened or if the attribute cannot be read.
Parameters
obj_nameUse "." if the attribute to read is on the HDF5 file otherwise the full path of the group or dataset.
attr_nameName of the attribute.
Returns
The vector of attribute values.

Implemented in eml2::HdfProxy.

◆ readStringAttribute()

virtual std::string eml2::AbstractHdfProxy::readStringAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
pure virtual

Reads a string which is stored as an HDF5 attribute in a file, group or dataset

Exceptions
std::invalid_argumentIf the HDF5 file is not opened or if the attribute cannot be read.
Parameters
obj_nameUse "." if the attribute to read is on the HDF5 file otherwise the full path of the group or dataset.
attr_nameName of the attribute.
Returns
The attribute value.

Implemented in eml2::HdfProxy.

◆ selectArrayNdOfValues()

virtual void eml2::AbstractHdfProxy::selectArrayNdOfValues ( const std::string & datasetName,
uint64_t const * blockCountPerDimension,
uint64_t const * offsetInEachDimension,
uint64_t const * strideInEachDimension,
uint64_t const * blockSizeInEachDimension,
unsigned int numDimensions,
bool newSelection,
hdf5_hid_t & dataset,
hdf5_hid_t & filespace )
pure virtual

Considering a given nd array dataset, this method selects an hyperslab region to add to an existing selected region or to add to a new selected region. The dataset is not closed within this method.

Exceptions
invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
datasetNameThe name of the nd array dataset.
blockCountPerDimensionNumber of blocks to select from the dataspace, in each dimension. They are ordered from fastest index to slowest index.
offsetInEachDimensionOffset values in each dimension of the array to read. They are ordered from fastest index to slowest index.
strideInEachDimensionNumber of elements to move from one block to another in each dimension. They are ordered from fastest index to slowest index.
blockSizeInEachDimensionSize of selected blocks in each dimension. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to read.
newSelectiontrue if creating a new selected region else false.
[in,out]datasetInput dataset ID if adding a new hyperslab region to an existing selected region, output dataset ID if creating a new selected region.
[in,out]filespaceInput selected region ID if adding a new hyperslab region to an existing selected region, output selected region ID if creating a new selected region.

Implemented in eml2::HdfProxy.

◆ setCompressionLevel()

virtual void eml2::AbstractHdfProxy::setCompressionLevel ( unsigned int newCompressionLevel)
pure virtual

Sets the new compression level which will be used for all data to be written

Parameters
newCompressionLevelThe new compression level in range [0..9]. Lower compression levels are faster but result in less compression.

Implemented in eml2::HdfProxy.

◆ setMaxChunkSize()

void eml2::AbstractHdfProxy::setMaxChunkSize ( unsigned int newMaxChunkSize)
inline

Set the maximum size for a chunk of a dataset only in case the HDF5 file is compressed. Chunk dimensions, and consequently actual size, will be computed from this maximum chunk memory size. Chunks dimensions are computed by reducing dataset dimensions from slowest to fastest until the max chunk size is honored.

Example : Let's take a 3d property 4x3x2 (fastest from slowest) of double with a max chunk size of 100 bytes The total size of this property is 4*3*2*8 = 192 bytes which is greater than 100 bytes, the max chunk size. The computed chunk dimension will consequently be 4*3*1 = 96 which is lower than (not equal to) 100 bytes, the max chunk size. If we would have set a max chunk size of 20 bytes, the chunk dimension would have been computed as 2*1*1 (16 bytes), etc...

Parameters
newMaxChunkSizeThe maximum chunk size to set in bytes.

◆ setOpeningMode()

void eml2::AbstractHdfProxy::setOpeningMode ( common ::DataObjectRepository::openingMode openingMode_)
inline

Sets the rights when opening the HDF5 file

Parameters
openingMode_The opening mode of the HDF5 file.

◆ setRelativePath()

void eml2::AbstractHdfProxy::setRelativePath ( const std::string & relPath)
inline

Sets the relative path of the HDF5 file regarding the path of the directory containing the EPC file associated to this HDF5 file

Parameters
relPathRelative path of the HDF5 file.

◆ setRootPath()

void eml2::AbstractHdfProxy::setRootPath ( const std::string & rootPath)
inline

Sets the path of the directory containing the EPC file associated to this HDF5 file

Parameters
rootPathPath of the directory containing the EPC file.

◆ writeArrayNd()

virtual void eml2::AbstractHdfProxy::writeArrayNd ( const std::string & groupName,
const std::string & name,
common ::AbstractObject::numericalDatatypeEnum datatype,
const void * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
pure virtual

Writes an nd array of a specific datatype into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of specific datatype values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
datatypeThe specific datatype of the values to write.
values1d array of specific datatype values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

Implemented in eml2::HdfProxy.

◆ writeArrayNdOfDoubleValues()

void eml2::AbstractHdfProxy::writeArrayNdOfDoubleValues ( const std::string & groupName,
const std::string & name,
const double * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of double values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of double values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
dblValues1d array of double values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of dimensions (n) of the nd array to write.

◆ writeArrayNdOfFloatValues()

void eml2::AbstractHdfProxy::writeArrayNdOfFloatValues ( const std::string & groupName,
const std::string & name,
const float * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of float values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of float values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
floatValues1d array of float values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of dimensions (n) of the nd array to write.

◆ writeArrayNdOfInt64Values()

void eml2::AbstractHdfProxy::writeArrayNdOfInt64Values ( const std::string & groupName,
const std::string & name,
const int64_t * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of integer 64 values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of gSOAP unsigned long 64 values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
values1d array of integer 64 values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

◆ writeArrayNdOfInt8Values()

void eml2::AbstractHdfProxy::writeArrayNdOfInt8Values ( const std::string & groupName,
const std::string & name,
const int8_t * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of int 8 bits values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of int values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
intValues1d array of int 8 bits values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

◆ writeArrayNdOfIntValues()

void eml2::AbstractHdfProxy::writeArrayNdOfIntValues ( const std::string & groupName,
const std::string & name,
const int * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of int values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of int values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
intValues1d array of int values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

◆ writeArrayNdOfUInt64Values()

void eml2::AbstractHdfProxy::writeArrayNdOfUInt64Values ( const std::string & groupName,
const std::string & name,
const uint64_t * values,
const uint64_t * numValuesInEachDimension,
unsigned int numDimensions )
inline

Writes an nd array of unsigned integer 64 values into the HDF5 file by means of a single dataset

Parameters
groupNameThe name of the group where to create the nd array of gSOAP unsigned long 64 values. This name must not contain '/' character and must be directly contained in RESQML group.
nameThe name of the nd array HDF5 dataset. It must not already exist.
values1d array of unsigned integer 64 values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

◆ writeArrayNdSlab()

virtual void eml2::AbstractHdfProxy::writeArrayNdSlab ( const std::string & groupName,
const std::string & name,
common ::AbstractObject::numericalDatatypeEnum datatype,
const void * values,
const uint64_t * numValuesInEachDimension,
const uint64_t * offsetValuesInEachDimension,
unsigned int numDimensions )
pure virtual

Finds the nd array associated with groupName and name and writes into it

Parameters
groupNameThe name of the group associated with the nd array.
nameThe name of the nd array dataset.
datatypeThe datatype of the nd array values.
values1d array of datatype values ordered firstly by fastest direction.
numValuesInEachDimensionNumber of values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
offsetValuesInEachDimensionOffset values in each dimension of the nd array to write. They are ordered from fastest index to slowest index.
numDimensionsThe number of the dimensions (n) of the nd array to write.

Implemented in eml2::HdfProxy.

◆ writeDatasetAttribute()

virtual void eml2::AbstractHdfProxy::writeDatasetAttribute ( const std::string & datasetName,
const std::string & attributeName,
const std::vector< std::string > & values )
pure virtual

Writes a single attribute into a dataset which contain an array of strings values

Parameters
datasetNameName of the dataset.
attributeNameName of the attribute.
valuesVector of string values.

Implemented in eml2::HdfProxy.

◆ writeDatasetAttributes() [1/3]

virtual void eml2::AbstractHdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< double > & values )
pure virtual

Writes some double attributes into a dataset

Exceptions
std::invalid_argumentAttributes names and double values vector do not have the same size.
Parameters
datasetNameName of the dataset.
attributeNamesVector of attributes names.
valuesVector of double values.

Implemented in eml2::HdfProxy.

◆ writeDatasetAttributes() [2/3]

virtual void eml2::AbstractHdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< int > & values )
pure virtual

Writes some int attributes into a dataset

Exceptions
std::invalid_argumentAttributes names and int values vector do not have the same size.
Parameters
datasetNameName of the dataset.
attributeNamesVector of attributes names.
valuesVector of int values.

Implemented in eml2::HdfProxy.

◆ writeDatasetAttributes() [3/3]

virtual void eml2::AbstractHdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< std::string > & values )
pure virtual

Writes some string attributes into a dataset

Exceptions
std::invalid_argumentAttributes names and string values vector do not have the same size.
Parameters
datasetNameName of the dataset.
attributeNamesVector of attributes names.
valuesVector of string values.

Implemented in eml2::HdfProxy.

◆ writeGroupAttribute()

virtual void eml2::AbstractHdfProxy::writeGroupAttribute ( const std::string & groupName,
const std::string & attributeName,
const std::vector< std::string > & values )
pure virtual

Writes a single attribute into a group which contains an array of string values

Parameters
groupNameName of the group.
attributeNameName of the attribute.
valuesVector of string values.

Implemented in eml2::HdfProxy.

◆ writeGroupAttributes() [1/3]

virtual void eml2::AbstractHdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< double > & values )
pure virtual

Writes some double attributes into a group

Exceptions
std::invalid_argumentAttributes names and double values vector do not have the same size.
Parameters
groupNameName of the group.
attributeNamesVector of attributes names.
valuesVector of double values.

Implemented in eml2::HdfProxy.

◆ writeGroupAttributes() [2/3]

virtual void eml2::AbstractHdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< int > & values )
pure virtual

Writes some int attributes into a group

Exceptions
std::invalid_argumentAttributes names and int values vector do not have the same size.
Parameters
groupNameName of the group.
attributeNamesVector of attributes names.
valuesVector of int values.

Implemented in eml2::HdfProxy.

◆ writeGroupAttributes() [3/3]

virtual void eml2::AbstractHdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< std::string > & values )
pure virtual

Writes some string attributes into a group

Exceptions
std::invalid_argumentAttributes names and string values vector do not have the same size.
Parameters
groupNameName of the group.
attributeNamesVector of attributes names.
valuesVector of string values.

Implemented in eml2::HdfProxy.

◆ writeItemizedListOfList()

virtual void eml2::AbstractHdfProxy::writeItemizedListOfList ( const std::string & groupName,
const std::string & name,
common ::AbstractObject::numericalDatatypeEnum cumulativeLengthDatatype,
const void * cumulativeLength,
uint64_t cumulativeLengthSize,
common ::AbstractObject::numericalDatatypeEnum elementsDatatype,
const void * elements,
uint64_t elementsSize )
pure virtual

Writes an itemized list of lists into the HDF5 file by means of a single group containing two datasets: one for the elements and one for the cumulative lengths of the lists of elements.

Parameters
groupNameThe name of the group where to create the itemized list of lists. This name must not contain '/' character and must be directly contained in the RESQML group.
nameThe name of the itemized list of lists HDF5 group.
cumulativeLengthDatatypeThe datatype of the cumulative lengths dataset to write.
cumulativeLength1d array of positive integers containing for each list the sum of all the previous lists lengths including the current one.
cumulativeLengthSizeSize of the cumulative lengths array.
elementsDatatypeThe datatype of the elements to write.
elements1d array of elements containing the aggregation of individual lists contents.
elementsSizeSize of the elements array. It must be equal to cumulativeLength[cumulativeLengthSize-1].

Implemented in eml2::HdfProxy.

Member Data Documentation

◆ CUMULATIVE_LENGTH_DS_NAME

constexpr char const* eml2::AbstractHdfProxy::CUMULATIVE_LENGTH_DS_NAME = "cumulativeLength"
staticconstexpr

Defines cumulative length ds name

◆ ELEMENTS_DS_NAME

constexpr char const* eml2::AbstractHdfProxy::ELEMENTS_DS_NAME = "elements"
staticconstexpr

Defines elements ds name


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