Fesapi 2.10.1.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
eml2::HdfProxy Class Reference

A proxy for reading and writing values into an HDF5 file. More...

#include <HdfProxy.h>

Inheritance diagram for eml2::HdfProxy:
eml2::AbstractHdfProxy eml2::EpcExternalPartReference common::AbstractObject eml2_0::HdfProxy eml2_0::HdfProxyMPI eml2_3::HdfProxy eml2_0::HdfProxyROS3

Public Member Functions

 HdfProxy (gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
 
 HdfProxy (const common::DataObjectReference &dor)
 Constructor.
 
virtual ~HdfProxy ()
 
void open () override
 
bool isOpened () const final
 
void close () final
 
common::AbstractObject::numericalDatatypeEnum getNumericalDatatype (const std::string &groupName) final
 
int getHdfDatatypeClassInDataset (const std::string &datasetName) final
 
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) final
 
std::vector< uint32_t > getElementCountPerDimension (const std::string &datasetName) final
 
void setCompressionLevel (unsigned int newCompressionLevel) final
 
void writeArrayNd (const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum datatype, const void *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions) final
 
void createArrayNd (const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum datatype, const uint64_t *numValuesInEachDimension, unsigned int numDimensions) final
 
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) final
 
void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values) final
 
void writeGroupAttribute (const std::string &groupName, const std::string &attributeName, const std::vector< std::string > &values) final
 
void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< double > &values) final
 
void writeGroupAttributes (const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< int > &values) final
 
void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values) final
 
void writeDatasetAttribute (const std::string &datasetName, const std::string &attributeName, const std::vector< std::string > &values) final
 
void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< double > &values) final
 
void writeDatasetAttributes (const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< int > &values) final
 
std::string readStringAttribute (const std::string &obj_name, const std::string &attr_name) const final
 
std::vector< std::string > readStringArrayAttribute (const std::string &obj_name, const std::string &attr_name) const final
 
double readDoubleAttribute (const std::string &obj_name, const std::string &attr_name) const final
 
int64_t readInt64Attribute (const std::string &obj_name, const std::string &attr_name) const final
 
void readArrayNdOfDoubleValues (const std::string &datasetName, double *values) final
 
void readArrayNdOfDoubleValues (const std::string &datasetName, double *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions) final
 
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) final
 
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) final
 
void readArrayNdOfDoubleValues (hdf5_hid_t dataset, hdf5_hid_t filespace, void *values, uint64_t slabSize) final
 
void readArrayNdOfFloatValues (const std::string &datasetName, float *values) final
 
void readArrayNdOfFloatValues (const std::string &datasetName, float *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions) final
 
void readArrayNdOfInt64Values (const std::string &datasetName, int64_t *values) final
 
void readArrayNdOfInt64Values (const std::string &datasetName, int64_t *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions) final
 
void readArrayNdOfUInt64Values (const std::string &datasetName, uint64_t *values) final
 
void readArrayNdOfIntValues (const std::string &datasetName, int *values) final
 
void readArrayNdOfIntValues (const std::string &datasetName, int *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions) final
 
void readArrayNdOfUIntValues (const std::string &datasetName, unsigned int *values) final
 
void readArrayNdOfShortValues (const std::string &datasetName, short *values) final
 
void readArrayNdOfUShortValues (const std::string &datasetName, unsigned short *values) final
 
void readArrayNdOfInt8Values (const std::string &datasetName, int8_t *values) final
 
void readArrayNdOfUInt8Values (const std::string &datasetName, uint8_t *values) final
 
bool exist (const std::string &absolutePathInHdfFile) const final
 
bool isCompressed (const std::string &datasetName) final
 
std::vector< uint32_t > getElementCountPerChunkDimension (const std::string &datasetName) final
 
- Public Member Functions inherited from eml2::AbstractHdfProxy
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
 
uint64_t getDimensionCount (const std::string &datasetName)
 
uint64_t getElementCount (const std::string &datasetName)
 
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)
 
void setMaxChunkSize (unsigned int newMaxChunkSize)
 
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
 
- Public Member Functions inherited from common::AbstractObject
bool isPartial () const
 
virtual bool isTopLevelElement () const
 
std::string getUuid () const
 
std::string getTitle () const
 
std::string getEditor () const
 
time_t getCreation () const
 
tm getCreationAsTimeStructure () const
 
std::string getOriginator () const
 
std::string getDescription () const
 
time_t getLastUpdate () const
 
tm getLastUpdateAsTimeStructure () const
 
std::string getFormat () const
 
std::string getDescriptiveKeywords () const
 
std::string getVersion () const
 
void setTitle (const std::string &title)
 
void setEditor (const std::string &editor)
 
void setCreation (time_t creation)
 
void setCreation (const tm &creation)
 
void setOriginator (const std::string &originator)
 
void setDescription (const std::string &description)
 
void setLastUpdate (time_t lastUpdate)
 
void setLastUpdate (const tm &lastUpdate)
 
void setDescriptiveKeywords (const std::string &descriptiveKeywords)
 
void setVersion (const std::string &version)
 
void setMetadata (const std::string &title, const std::string &editor, time_t creation, const std::string &originator, const std::string &description, time_t lastUpdate, const std::string &descriptiveKeywords)
 
void serializeIntoStream (std::ostream *stream)
 
gsoap_resqml2_0_1::eml20__AbstractCitedDataObject * getEml20GsoapProxy () const
 
void setGsoapProxy (gsoap_resqml2_0_1::eml20__AbstractCitedDataObject *gsoapProxy)
 
gsoap_eml2_3::eml23__AbstractObject * getEml23GsoapProxy () const
 
void setGsoapProxy (gsoap_eml2_3::eml23__AbstractObject *gsoapProxy)
 
soap * getGsoapContext () const
 
int getGsoapType () const
 
gsoap_resqml2_0_1::eml20__DataObjectReference * newResqmlReference () const
 
gsoap_eml2_3::eml23__DataObjectReference * newEml23Reference () const
 
gsoap_resqml2_0_1::resqml20__ContactElementReference * newContactElementReference2_0_1 () const
 
gsoap_eml2_3::resqml22__ContactElement * newContactElementReference2_2 () const
 
common::DataObjectRepositorygetRepository () const
 
virtual std::string getXmlNamespace () const =0
 
virtual std::string getXmlNamespaceVersion () const
 
virtual std::string getContentType () const
 
virtual std::string getQualifiedType () const
 
virtual std::string getPartNameInEpcDocument () const
 
std::string serializeIntoString ()
 
void addAlias (const std::string &authority, const std::string &title)
 
uint64_t getAliasCount () const
 
std::string getAliasAuthorityAtIndex (uint64_t index) const
 
std::string getAliasTitleAtIndex (uint64_t index) const
 
std::vector< eml2::Activity * > getActivitySet () const
 
uint64_t getActivityCount () const
 
eml2::ActivitygetActivity (uint64_t index) const
 
void pushBackExtraMetadata (const std::string &key, const std::string &value)
 
std::unordered_map< std::string, std::string > getExtraMetadataSet () const
 
std::vector< std::string > getExtraMetadata (const std::string &key) const
 
unsigned int getExtraMetadataCount () const
 
std::string getExtraMetadataKeyAtIndex (unsigned int index) const
 
std::string getExtraMetadataStringValueAtIndex (unsigned int index) const
 
std::string buildEtp12Uri () const
 
void setUriSource (const std::string &uriSource)
 
const std::string & getUriSource () const
 
std::string getEpcSourceFolder () const
 
void changeToPartialObject ()
 

Additional Inherited Members

- Public Types inherited from common::AbstractObject
enum class  numericalDatatypeEnum {
  UNKNOWN = 0 , DOUBLE = 1 , FLOAT = 2 , INT64 = 3 ,
  UINT64 = 4 , INT32 = 5 , UINT32 = 6 , INT16 = 7 ,
  UINT16 = 8 , INT8 = 9 , UINT8 = 10
}
 
- Static Public Member Functions inherited from common::AbstractObject
static void setFormat (const std::string &vendor, const std::string &applicationName, const std::string &applicationVersionNumber)
 
- Static Public Attributes inherited from eml2::AbstractHdfProxy
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

A proxy for reading and writing values into an HDF5 file.

Constructor & Destructor Documentation

◆ HdfProxy() [1/2]

eml2::HdfProxy::HdfProxy ( gsoap_resqml2_0_1::eml20__DataObjectReference * partialObject)
inline

Constructor. Only to be used in partial transfer context

Parameters
[in]partialObjectIf non-null, the partial object.

◆ HdfProxy() [2/2]

eml2::HdfProxy::HdfProxy ( const common::DataObjectReference & dor)
inline

Constructor.

Parameters
dorThe dor.

◆ ~HdfProxy()

virtual eml2::HdfProxy::~HdfProxy ( )
inlinevirtual

Destructor. Closes the hdf file.

Reimplemented in eml2_0::HdfProxy, and eml2_3::HdfProxy.

Member Function Documentation

◆ close()

void eml2::HdfProxy::close ( )
finalvirtual

Closes the HDF5 file

Implements eml2::AbstractHdfProxy.

◆ createArrayNd()

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

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.

Implements eml2::AbstractHdfProxy.

◆ exist()

bool eml2::HdfProxy::exist ( const std::string & absolutePathInHdfFile) const
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ getElementCountPerChunkDimension()

std::vector< uint32_t > eml2::HdfProxy::getElementCountPerChunkDimension ( const std::string & datasetName)
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ getElementCountPerDimension()

std::vector< uint32_t > eml2::HdfProxy::getElementCountPerDimension ( const std::string & datasetName)
finalvirtual

Get the number of elements in each dimension in an HDF dataset of the proxy. 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 we want to get the number of elements.

Implements eml2::AbstractHdfProxy.

◆ getHdfDatatypeClassInDataset()

int eml2::HdfProxy::getHdfDatatypeClassInDataset ( const std::string & datasetName)
finalvirtual

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).

Implements eml2::AbstractHdfProxy.

◆ getNumericalDatatype()

common::AbstractObject::numericalDatatypeEnum eml2::HdfProxy::getNumericalDatatype ( const std::string & datasetName)
finalvirtual

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;

Implements eml2::AbstractHdfProxy.

◆ isCompressed()

bool eml2::HdfProxy::isCompressed ( const std::string & datasetName)
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ isOpened()

bool eml2::HdfProxy::isOpened ( ) const
inlinefinalvirtual

Checks if the HDF5 file is open or not

Returns
True if opened, false if not.

Implements eml2::AbstractHdfProxy.

◆ open()

void eml2::HdfProxy::open ( )
overridevirtual

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

Implements eml2::AbstractHdfProxy.

Reimplemented in eml2_0::HdfProxyMPI, and eml2_0::HdfProxyROS3.

◆ readArrayNdOfDoubleValues() [1/4]

void eml2::HdfProxy::readArrayNdOfDoubleValues ( const std::string & datasetName,
double * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfDoubleValues() [2/4]

void eml2::HdfProxy::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 )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfDoubleValues() [3/4]

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

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfDoubleValues() [4/4]

void eml2::HdfProxy::readArrayNdOfDoubleValues ( hdf5_hid_t dataset,
hdf5_hid_t filespace,
void * values,
uint64_t slabSize )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfFloatValues() [1/2]

void eml2::HdfProxy::readArrayNdOfFloatValues ( const std::string & datasetName,
float * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfFloatValues() [2/2]

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

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfInt64Values() [1/2]

void eml2::HdfProxy::readArrayNdOfInt64Values ( const std::string & datasetName,
int64_t * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfInt64Values() [2/2]

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

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfInt8Values()

void eml2::HdfProxy::readArrayNdOfInt8Values ( const std::string & datasetName,
int8_t * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfIntValues() [1/2]

void eml2::HdfProxy::readArrayNdOfIntValues ( const std::string & datasetName,
int * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfIntValues() [2/2]

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

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfShortValues()

void eml2::HdfProxy::readArrayNdOfShortValues ( const std::string & datasetName,
short * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfUInt64Values()

void eml2::HdfProxy::readArrayNdOfUInt64Values ( const std::string & datasetName,
uint64_t * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfUInt8Values()

void eml2::HdfProxy::readArrayNdOfUInt8Values ( const std::string & datasetName,
uint8_t * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfUIntValues()

void eml2::HdfProxy::readArrayNdOfUIntValues ( const std::string & datasetName,
unsigned int * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readArrayNdOfUShortValues()

void eml2::HdfProxy::readArrayNdOfUShortValues ( const std::string & datasetName,
unsigned short * values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readDoubleAttribute()

double eml2::HdfProxy::readDoubleAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readInt64Attribute()

int64_t eml2::HdfProxy::readInt64Attribute ( const std::string & obj_name,
const std::string & attr_name ) const
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readStringArrayAttribute()

std::vector< std::string > eml2::HdfProxy::readStringArrayAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ readStringAttribute()

std::string eml2::HdfProxy::readStringAttribute ( const std::string & obj_name,
const std::string & attr_name ) const
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ selectArrayNdOfValues()

void eml2::HdfProxy::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 )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ setCompressionLevel()

void eml2::HdfProxy::setCompressionLevel ( unsigned int newCompressionLevel)
inlinefinalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeArrayNd()

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

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.

Implements eml2::AbstractHdfProxy.

◆ writeArrayNdSlab()

void eml2::HdfProxy::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 )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeDatasetAttribute()

void eml2::HdfProxy::writeDatasetAttribute ( const std::string & datasetName,
const std::string & attributeName,
const std::vector< std::string > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeDatasetAttributes() [1/3]

void eml2::HdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< double > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeDatasetAttributes() [2/3]

void eml2::HdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< int > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeDatasetAttributes() [3/3]

void eml2::HdfProxy::writeDatasetAttributes ( const std::string & datasetName,
const std::vector< std::string > & attributeNames,
const std::vector< std::string > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeGroupAttribute()

void eml2::HdfProxy::writeGroupAttribute ( const std::string & groupName,
const std::string & attributeName,
const std::vector< std::string > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeGroupAttributes() [1/3]

void eml2::HdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< double > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeGroupAttributes() [2/3]

void eml2::HdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< int > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeGroupAttributes() [3/3]

void eml2::HdfProxy::writeGroupAttributes ( const std::string & groupName,
const std::vector< std::string > & attributeNames,
const std::vector< std::string > & values )
finalvirtual

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.

Implements eml2::AbstractHdfProxy.

◆ writeItemizedListOfList()

void eml2::HdfProxy::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 )
finalvirtual

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].

Implements eml2::AbstractHdfProxy.


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