Hdf5File Class Reference

The HDF File is provided as an abstraction of the structure of the HDF File on disk without requiring the HDF libraries installed. More...

#include <Hdf5File.h>

Inheritance diagram for Hdf5File:

Inheritance graph

List of all members.

Public Member Functions

 Hdf5File (const std::string &filename, hid_t fileHandle=-1)
 ~Hdf5File ()
virtual Hdf5GroupgetRootGroup () const
virtual std::string getFilename () const
virtual hid_t getFileHandle () const
bool readFileData (const std::string &groupPath="/")
virtual Hdf5FilegetFile () const


Detailed Description

The HDF File is provided as an abstraction of the structure of the HDF File on disk without requiring the HDF libraries installed.

Definition at line 25 of file Hdf5File.h.


Constructor & Destructor Documentation

Hdf5File::Hdf5File ( const std::string &  filename,
hid_t  fileHandle = -1 
) [explicit]

Creates an Hdf5File with a given filename.

Parameters:
filename The name of the HDF file on disk.
fileHandle Handle to a previously open file, or -1 if the file is currently unavailable. This object does NOT assume ownership of fileHandle.

Hdf5File::~Hdf5File (  ) 

Destroys the Hdf5File object.


Member Function Documentation

virtual Hdf5Group* Hdf5File::getRootGroup (  )  const [virtual]

Returns a pointer to the file's 'root group' object.

The root group will be empty until readFileData() is called.

Returns:
A pointer to the Hdf5File's root group object. Cannot be NULL.
See also:
readFileData()

virtual std::string Hdf5File::getFilename (  )  const [virtual]

Returns the name of the file.

Returns:
The filename provided to the constructor.

virtual hid_t Hdf5File::getFileHandle (  )  const [virtual]

Returns the file handle.

Returns:
The fileHandle provided to the constructor.

bool Hdf5File::readFileData ( const std::string &  groupPath = "/"  ) 

Reads the HDF file at the specified path, opening and closing it if necessary.

This method reads the data from the file. If the fileHandle passed to the constructor was valid, then that handle will be used to access the file. If the fileHandle passed to the constructor was not valid, then the file will be opened, read, and closed before returning from this method.

Parameters:
groupPath The desired HDF group to read. This group will be iterated over via H5Giterate. The results are stored in the 'root group' object with paths relative to the root of the HDF file.
Returns:
True on success, false otherwise.
See also:
getRootGroup(), getFileHandle(), getFilename()

virtual Hdf5File* Hdf5File::getFile (  )  const [virtual]

Returns a pointer to the Hdf5File object that this object belongs to.

Returns:
Returns a pointer to the owning Hdf5File object.

Reimplemented from Hdf5Node.


Software Development Kit - Opticks 4.9.0 Build 16218