Hdf5Data Class Reference

This class is an abstraction of the data contained within a HDF5 attribute or HDF5 dataset. More...

#include <Hdf5Data.h>

Inheritance diagram for Hdf5Data:

Inheritance graph

List of all members.

Public Member Functions

virtual ~Hdf5Data ()
virtual std::string getTypeName () const
virtual void setTypeName (const std::string &typeName)
virtual const std::vector
< hsize_t > & 
getDimensionSizes () const
virtual void setDimensionSizes (const std::vector< hsize_t > &dimensionSizes)
template<typename T>
T * readData () const

Protected Member Functions

 Hdf5Data ()
virtual DataReader * createReader () const =0

Protected Attributes

std::string mTypeName
std::vector< hsize_t > mDimensionSizes


Detailed Description

This class is an abstraction of the data contained within a HDF5 attribute or HDF5 dataset.

This class provides a way to determine the type of data stored within the attribute or dataset along with the dimensions. This class also provides a templated method to extract the contents of the attribute or dataset.

Definition at line 28 of file Hdf5Data.h.


Constructor & Destructor Documentation

virtual Hdf5Data::~Hdf5Data (  )  [virtual]

Definition at line 31 of file Hdf5Data.h.

Hdf5Data::Hdf5Data (  )  [protected]


Member Function Documentation

virtual std::string Hdf5Data::getTypeName (  )  const [virtual]

Gets the type name of this HDF data.

Returns:
the type name of this HDF data.
See also:
HdfUtilities::hdf5TypeToTypeString() for more details.

virtual void Hdf5Data::setTypeName ( const std::string &  typeName  )  [virtual]

Sets the type name of this HDF data.

Parameters:
typeName The type name of this HDF data. See HdfUtilities::hdf5TypeToTypeString() for more details.

virtual const std::vector<hsize_t>& Hdf5Data::getDimensionSizes (  )  const [virtual]

Returns the sizes of the dimensions of the HDF data.

If data contains a scalar value, the returned vector will be empty. For example, if the data has 3 dimensions with sizes of 10, 50, 5, the getDimensionSizes().size() method should return 3. The getDimensionSizes()[0] should return 10 and getDimensionSizes()[1] should return 50.

Returns:
The sizes of the dimensions of the dataset.

virtual void Hdf5Data::setDimensionSizes ( const std::vector< hsize_t > &  dimensionSizes  )  [virtual]

Sets the dimension sizes of this HDF data.

If the data contains a scalar value, the provided vector should be empty.

Parameters:
dimensionSizes The dimension sizes of the HDF data.

template<typename T>
T* Hdf5Data::readData (  )  const

Reads data from the HDF object.

The caller of this function is responsible for deleting the returned memory.

Returns:
Returns the parsed value. If the data was not of the correct type or dimension, NULL will be returned.

Definition at line 80 of file Hdf5Data.h.

virtual DataReader* Hdf5Data::createReader (  )  const [protected, pure virtual]

Implemented in Hdf5Attribute, and Hdf5Dataset.


Member Data Documentation

std::string Hdf5Data::mTypeName [protected]

Definition at line 117 of file Hdf5Data.h.

std::vector<hsize_t> Hdf5Data::mDimensionSizes [protected]

Definition at line 118 of file Hdf5Data.h.


Software Development Kit - Opticks 4.9.0 Build 16218