Public Member Functions | Protected Member Functions | Protected Attributes

HDF5FileData Class Reference

#include <hdf5filedata.h>

Inheritance diagram for HDF5FileData:
Inheritance graph
[legend]
Collaboration diagram for HDF5FileData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HDF5FileData (const string &name=string(""), const string &mode=string("r"))
virtual void * read_data (void *data, const char *sds_name, int *start=NULL, int *stride=NULL, int *edges=NULL, int rank=-1)
 Read the selected data in the file.
virtual vector< int > get_dataset_dimension (const string &sds_name)
 return the given dataset size along each axis
virtual void get_dataset_fill_value (const string &sds_name, void *fill_value)
 read the given dataset's fill value TODO Same method with many names of this method transfered from filedatareader. Need to be reformatted after functionnal tests with Data2Grid/MapsOperator
virtual int get_n_dataset ()
virtual string get_dataset_name (int i)
virtual int get_dataset_data_type (string sds_name)
virtual string get_values_attr_dataset (string sds_name, string attr_name)
virtual bool has_attr_dataset (string sds_name, string attr_name)
virtual string get_values_attr (string attr_name)
virtual bool has_attr (string attr_name)
virtual void close_data_file ()
 closes the file
virtual void open_data_file ()
 open the file
void get_fillValue (const string &sds_name, void *fillValue)
void get_scaling (const string &sds_name, float64 &scale, float64 &offset)

Protected Member Functions

void read_all_dataset ()
void free_read_write_allocations (const bool *are_limits_initialized, int *start, int *stride, int *edges)
const bool check_read_write_limits (const char *sds_name, int *start, int *stride, int *edges, const int rank)
void init_read_write_null_input_param (const char *sds_name, int *&start, int *&stride, int *&edges, int &rank, bool *initialized_values)
void read_line (string line, string &tag, string &value)
void read_metadata ()
void trim (string &token)
void split (const string &str, vector< string > &tokens, const string &delimiters)

Protected Attributes

string name
hid_t file_id
map< string, hid_t > dataset_map
vector< string > dataset_vect
vector< hid_t > attributes
map< string, string > attribute
bool read_dataset_done

Detailed Description

Author:
James MANLEY

Member Function Documentation

vector< int > HDF5FileData::get_dataset_dimension ( const string &  sds_name  )  [virtual]

return the given dataset size along each axis

Parameters:
ds_name [IN] dataset name
Returns:
the axis dimensions in ordering [..., Z, Y, X]

Reimplemented from FileData.

Referenced by read_data().

void HDF5FileData::get_dataset_fill_value ( const string &  ds_name,
void *  fillvalue 
) [virtual]

read the given dataset's fill value TODO Same method with many names of this method transfered from filedatareader. Need to be reformatted after functionnal tests with Data2Grid/MapsOperator

Parameters:
ds_name [IN] dataset name
fillvalue [OUT] fill value.

Reimplemented from FileData.

void * HDF5FileData::read_data ( void *  data,
const char *  sds_name,
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int  rank = -1 
) [virtual]

Read the selected data in the file.

Warning:
If you delegate the allocation of the buffer at this method, you need to call delete[] data yourself.
Parameters:
data the buffer to fill with the read values. Can be NULL. In this case, the allocation is done by the method
sds_name the name of the sds (Scientific Data Set) we want to access.
start begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3...
stride step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read)
edges number of values to be read in each dimension. if NULL, it will be all data along each dimension.
rank the dimension of start, stride and edges
Returns:
a pointer to the read data array. It is useful when you let this method manage the allocation to update the allocated pointer to the data. If you've done it yourself or you are using a static buffer, it isn't necessary to catch this return pointer

Implements FileData.

References get_dataset_dimension().

Referenced by OMIFileData::load_geolocation_data().


Member Data Documentation

string HDF5FileData::name [protected]

the name of the file (with its path)

Reimplemented from FileData.

Referenced by open_data_file().


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