Classes | |
| class | Hdf4FileObject |
| The Hdf4FileObject is a trait object for use with the Resource template. More... | |
| class | Hdf4FileResource |
| This is a Resource class that opens and closes HDF4 files. More... | |
| class | Hdf4DatasetObject |
| This is an implementation detail of the Hdf4DatasetObject class. More... | |
| class | Hdf4DatasetResource |
| This is a Resource class that opens and closes HDF4 datasets. More... | |
| class | Exception |
| An HdfUtilitiesException is a simple exception that wraps a string. More... | |
Functions | |
| template<typename T> | |
| bool | getAttribute (const Hdf4Element &element, const std::string &attributeName, T &actualValue) |
| std::string | hdf4TypeToString (long type, size_t count) |
| bool | readHdf4Attribute (int32 obj_id, int32 attr_index, DataVariant &var) |
| std::string | hdf5TypeToTypeString (hid_t dataTypeId) |
| bool | readHdf5Attribute (hid_t attrId, DataVariant &var) |
| std::string | hdf5AttributeToString (hid_t attrId) |
| template<typename T> | |
| bool | writeAttribute (hid_t dataDescriptor, const std::string &attributeName, const T &attributeValue) |
| template<typename T> | |
| bool | writeDataset (hid_t fileDescriptor, const std::string &datasetName, const T &datasetValue) |
| template<typename T> | |
| Hdf5TypeResource | getHdf5Type () |
| bool | createGroups (const std::string &hdfPath, hid_t fileDescriptor, bool bLastItemIsGroup=false) |
| unsigned int | getDataSize (EncodingType dataType) |
| std::vector< double > | createWavelengthVector (void *pData, size_t numElements, EncodingType type) |
Variables | |
| static const std::string | UNKNOWN_INTEGER_TYPE = "Unknown HDF5 Integer Type" |
| static const std::string | UNKNOWN_FLOAT_TYPE = "Unknown HDF5 Float Type" |
| static const std::string | TIME_TYPE = "HDF5 Time Type" |
| static const std::string | ARRAY_TYPE = "HDF5 Array Type" |
| static const std::string | BITFIELD_TYPE = "HDF5 Bitfield Type" |
| static const std::string | OPAQUE_TYPE = "HDF5 Opaque Type" |
| static const std::string | COMPOUND_TYPE = "HDF5 Compound Type" |
| static const std::string | REFERENCE_TYPE = "HDF5 Reference Type" |
| static const std::string | ENUM_TYPE = "HDF5 ENUM Type" |
| static const std::string | VLEN_TYPE = "HDF5 VLEN Type" |
| static const std::string | UNKNOWN_TYPE = "Unknown" |
| bool HdfUtilities::createGroups | ( | const std::string & | hdfPath, | |
| hid_t | fileDescriptor, | |||
| bool | bLastItemIsGroup = false | |||
| ) |
Creates one or more HDF5 groups with the given names.
| hdfPath | One or more group names, separated by a '/' character, to be created. | |
| fileDescriptor | A handle to the HDF5 file that the group(s) should be created in. | |
| bLastItemIsGroup | True if the last item in the string is a group, false otherwise. If this is false, the text after the final '/' in hdfPath is ignored. |
| std::vector<double> HdfUtilities::createWavelengthVector | ( | void * | pData, | |
| size_t | numElements, | |||
| EncodingType | type | |||
| ) |
Takes a void pointer and produces a wavelength vector.
WARNING: This function cannot provide range checking! If passed invalid values, this method throws an HdfUtilities::Exception.
| pData | A pointer to memory (most frequently read in using HdfImporter::loadDatasetFromFile()) that represents the wavelength vector. | |
| numElements | The number of elements in the vector. | |
| type | The data type of the wavelength vector. Valid values are INT1SBYTE, INT1UBYTE, INT2SBYTES, INT2UBYTES, INT4SBYTES, INT4UBYTES, INT4SCOMPLEX, FLT4BYTES, FLT8BYTES. If an invalid value is passed in for this argument (ie. UNKNOWN or INT4SCOMPLEX), an HdfUtilities::Exception is thrown. |
| bool HdfUtilities::getAttribute | ( | const Hdf4Element & | element, | |
| const std::string & | attributeName, | |||
| T & | actualValue | |||
| ) |
Reads an attribute from an Hdf4Element based on the attribute name.
Example usage:
// assume pElement is a pDataset is a valid, non-NULL Hdf4Dataset unsigned short badValue; if (HdfUtilities::getAttribute(*pDataset, "_FillValue", badValue) == false) { // error condition } // use _FillValue here
| element | The Hdf4Element from which to read the attribute. | |
| attributeName | The name of the attribute to read in. | |
| actualValue | Contains the actual value contained in the attribute. |
Definition at line 52 of file Hdf4Utilities.h.
| unsigned int HdfUtilities::getDataSize | ( | EncodingType | dataType | ) |
Returns the size of each data element given an EncodingType.
Throws an HdfUtilities::Exception() if an invalid data type is encountered.
| dataType | An EncodingType that represents the data. Never returns 0. |
| Hdf5TypeResource HdfUtilities::getHdf5Type | ( | ) |
| std::string HdfUtilities::hdf4TypeToString | ( | long | type, | |
| size_t | count | |||
| ) |
Converts an HDF4 type to a string that can be used to create an Hdf4Attribute.
| type | The HDF4 type (ie. DFNT_CHAR). | |
| count | The number of elements whose data type is 'type'. |
| std::string HdfUtilities::hdf5AttributeToString | ( | hid_t | attrId | ) |
Given an HDF5 Attribute handle, returns a string representing that attribute.
This method only supports attributes supported by StringUtilities::toString() and StringUtilities::fromString() minus the enumerated types in TypesFile.h.
Throws an HdfUtilities::Exception if an error occurs.
| attrId | The attribute id returned by H5Aopen(). |
| std::string HdfUtilities::hdf5TypeToTypeString | ( | hid_t | dataTypeId | ) |
Converts an HDF5 data type to a string.
This method simply returns a string representation of the type. It does not take the dataspace into account, ie. the dimensionality.
NOTE: You will need to statically link against the HDF5 libraries.
| dataTypeId | The value returned from H5Dget_type() or H5Aget_type(). |
| bool HdfUtilities::readHdf4Attribute | ( | int32 | obj_id, | |
| int32 | attr_index, | |||
| DataVariant & | var | |||
| ) |
Given an open HDF4 Attribute identifier retrieves the attribute and places it in a variant.
| obj_id | The object identifier that the attribute should be read from. | |
| attr_index | The index of the attribute to read. | |
| var | The variant that the attribute data will be placed in. |
| bool HdfUtilities::readHdf5Attribute | ( | hid_t | attrId, | |
| DataVariant & | var | |||
| ) |
Given an open HDF5 Attribute identifier retrieves the attribute and places it in a variant.
| attrId | A handle to the HDF attribute. | |
| var | The variant that the attribute data will be placed in. |
| bool HdfUtilities::writeAttribute | ( | hid_t | dataDescriptor, | |
| const std::string & | attributeName, | |||
| const T & | attributeValue | |||
| ) |
Creates an HDF5 attribute with a given name and value.
| dataDescriptor | A handle to the HDF5 dataset or HDF5 group that this attribute should be attached to. | |
| attributeName | The name of the attribute that should be created on the HDF5 dataset or HDF5 group. | |
| attributeValue | The value that the created attribute should have. The value will determine the HDF5 type and HDF5 dataspace of the created attribute. Specifically, the Hdf5CustomWriter created for T will determine both the HDF5 type and HDF5 dataspace. |
Definition at line 166 of file Hdf5Utilities.h.
| bool HdfUtilities::writeDataset | ( | hid_t | fileDescriptor, | |
| const std::string & | datasetName, | |||
| const T & | datasetValue | |||
| ) |
Creates an HDF5 dataset with a given name and value.
| fileDescriptor | A handle to the HDF5 file that this dataset should be created in. | |
| datasetName | The full path to where the HDF5 dataset should be created in the HDF5 file. This function assumes that any required groups in the path have already been created. | |
| datasetValue | The value that the created dataset should have. The value will determine the HDF5 type and HDF5 dataspace of the created dataset. Specifically, the Hdf5CustomWriter created for T will determine both the HDF5 type and HDF5 dataspace. |
Definition at line 222 of file Hdf5Utilities.h.
const std::string HdfUtilities::ARRAY_TYPE = "HDF5 Array Type" [static] |
Represents the H5T_ARRAY type.
The HdfPlugInLib will not parse data of this type.
Definition at line 52 of file Hdf5Utilities.h.
const std::string HdfUtilities::BITFIELD_TYPE = "HDF5 Bitfield Type" [static] |
Represents the H5T_BITFIELD type.
The HdfPlugInLib will not parse data of this type.
Definition at line 57 of file Hdf5Utilities.h.
const std::string HdfUtilities::COMPOUND_TYPE = "HDF5 Compound Type" [static] |
Represents the H5T_COMPOUND type.
The HdfPlugInLib will not parse data of this type.
Definition at line 67 of file Hdf5Utilities.h.
const std::string HdfUtilities::ENUM_TYPE = "HDF5 ENUM Type" [static] |
Represents the H5T_ENUM type.
The HdfPlugInLib will not parse data of this type.
Definition at line 77 of file Hdf5Utilities.h.
const std::string HdfUtilities::OPAQUE_TYPE = "HDF5 Opaque Type" [static] |
Represents the H5T_OPAQUE type.
The HdfPlugInLib will not parse data of this type.
Definition at line 62 of file Hdf5Utilities.h.
const std::string HdfUtilities::REFERENCE_TYPE = "HDF5 Reference Type" [static] |
Represents the H5T_REFERENCE type.
The HdfPlugInLib will not parse data of this type.
Definition at line 72 of file Hdf5Utilities.h.
const std::string HdfUtilities::TIME_TYPE = "HDF5 Time Type" [static] |
Represents the H5T_TIME type.
The HdfPlugInLib will not parse data of this type.
Definition at line 47 of file Hdf5Utilities.h.
const std::string HdfUtilities::UNKNOWN_FLOAT_TYPE = "Unknown HDF5 Float Type" [static] |
Represents a version of H5T_FLOAT type that the HdfPlugInLib does not know how to parse.
Definition at line 42 of file Hdf5Utilities.h.
const std::string HdfUtilities::UNKNOWN_INTEGER_TYPE = "Unknown HDF5 Integer Type" [static] |
Represents a version of H5T_INTEGER type that the HdfPlugInLib does not know how to parse.
Definition at line 37 of file Hdf5Utilities.h.
const std::string HdfUtilities::UNKNOWN_TYPE = "Unknown" [static] |
Represents an unknown type found in the Hdf file.
The HdfPlugInLib will not parse data of this type.
Definition at line 26 of file HdfUtilities.h.
const std::string HdfUtilities::VLEN_TYPE = "HDF5 VLEN Type" [static] |
Represents the H5T_VLEN type.
The HdfPlugInLib will not parse data of this type.
Definition at line 82 of file Hdf5Utilities.h.