HdfUtilities::Hdf4DatasetResource Class Reference

This is a Resource class that opens and closes HDF4 datasets. More...

#include <Hdf4Utilities.h>

Inheritance diagram for HdfUtilities::Hdf4DatasetResource:

Inheritance graph

List of all members.

Public Member Functions

 Hdf4DatasetResource (int32 fileHandle, const std::string &datasetName)
 Hdf4DatasetResource (int32 fileHandle, int dsIndex)
 operator int32 * ()


Detailed Description

This is a Resource class that opens and closes HDF4 datasets.

It has a conversion operator to allow an Hdf4DatasetResource object to be used where ever a int32* data handle would normally be used.

  bool readData(const string& filename, int index)
  {
     Hdf4FileResource file("c:/data/a.hdf");
     if (file.get() != NULL && *file != FAIL)
     {
        Hdf4DatasetResource dataset(*file, index);
        if (dataset.get() != NULL && *dataset != FAIL)
        {
           // do SDreaddata here
        }
     }
  }

Definition at line 309 of file Hdf4Utilities.h.


Constructor & Destructor Documentation

HdfUtilities::Hdf4DatasetResource::Hdf4DatasetResource ( int32  fileHandle,
const std::string &  datasetName 
)

Creates a resource to an Hdf4 dataset handle.

Auto-closes data handle when the object goes out of scope.

Parameters:
fileHandle A handle to the file that contains the dataset.
datasetName The name of the dataset to open. This is typically the easiest way to get a data handle since it takes the result from Hdf4Dataset::getName().

Definition at line 323 of file Hdf4Utilities.h.

HdfUtilities::Hdf4DatasetResource::Hdf4DatasetResource ( int32  fileHandle,
int  dsIndex 
)

Creates a resource to an Hdf4 dataset handle.

Auto-closes data handle when the object goes out of scope.

Parameters:
fileHandle A handle to the file that contains the dataset.
dsIndex The index, if known, of the dataset.

Definition at line 338 of file Hdf4Utilities.h.


Member Function Documentation

HdfUtilities::Hdf4DatasetResource::operator int32 * (  ) 

Allows for implict conversion of this resource type to an int32*.

Returns:
A pointer to an int32 reprsenting the file handle.

Definition at line 348 of file Hdf4Utilities.h.


Software Development Kit - Opticks 4.9.0 Build 16218