OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
h5das.cc File Reference

Data attributes processing source. More...

#include "hdf5_handler.h"
Include dependency graph for h5das.cc:

Go to the source code of this file.

Functions

void add_group_structure_info (DAS &das, const char *gname, char *oname, bool is_group)
 will insert group information in a structure format into DAS table. More...
 
void depth_first (hid_t pid, const char *gname, DAS &das)
 depth first traversal of hdf5 file attributes. More...
 
void find_gloattr (hid_t file, DAS &das)
 will fill in attributes of the root group into one DAS table. More...
 
string get_hardlink (hid_t pgroup, const string &oname)
 will put hardlink information into a DAS table. More...
 
void get_softlink (DAS &das, hid_t pgroup, const char *gname, const string &oname, int index, size_t val_size)
 
string print_attr (hid_t type, int loc, void *sm_buf)
 will get the printed representation of an attribute. More...
 
void read_comments (DAS &das, const string &varname, hid_t oid)
 will fill in attributes of a group's comment into DAS table. More...
 
void read_objects (DAS &das, const string &varname, hid_t oid, int num_attr)
 will fill in attributes of a dataset or a group into one DAS table. More...
 

Variables

HDF5PathFinder paths
 A variable for remembering visited paths to break cyclic HDF5 groups. More...
 

Detailed Description

Data attributes processing source.

This file is part of h5_dap_handler, a C++ implementation of the DAP handler for HDF5 data.

This is the HDF5-DAS that extracts DAS class descriptors converted from HDF5 attribute of an hdf5 data file.

Author
Hyo-Kyung Lee hyokl.nosp@m.ee@h.nosp@m.dfgro.nosp@m.up.o.nosp@m.rg
Muqun Yang myang.nosp@m.6@hd.nosp@m.fgrou.nosp@m.p.or.nosp@m.g

Definition in file h5das.cc.

Function Documentation

add_group_structure_info ( DAS &  das,
const char *  gname,
char *  oname,
bool  is_group 
)

will insert group information in a structure format into DAS table.

This function adds a special attribute called "HDF5_ROOT_GROUP" if the gname is "/". If is_group is true, it keeps appending new attribute table called oname under the gname path. If is_group is false, it appends a string attribute called oname. For details, see the HDF5-DAP2 Mapping Technical Note from [1].

[1] http://www.hdfgroup.org/projects/opendap/opendap_docs.html

Parameters
dasDAS object: reference
gnameabsolute group pathname of an object
onamename of object
is_groupindicates whether it's a dataset or group
Returns
nothing

Definition at line 916 of file h5das.cc.

References NULL.

Referenced by depth_first().

depth_first ( hid_t  pid,
const char *  gname,
DAS &  das 
)

depth first traversal of hdf5 file attributes.

This function will walk through an hdf5 group using depth- first approach to obtain all the group and dataset attributes of an hdf5 file. During the process of the depth first search, DAS table will be filled. In case of errors, an exception will be thrown.

Parameters
piddataset id(group id)
gnamegroup name(absolute name from the root group)
dasreference of DAS object
Returns
void

To keep track of soft links.

Definition at line 60 of file h5das.cc.

References add_group_structure_info(), depth_first(), DODS_NAMELEN, get_hardlink(), HDF5PathFinder::get_name(), get_softlink(), NULL, read_comments(), and read_objects().

Referenced by depth_first(), HDF5RequestHandler::hdf5_build_das(), HDF5RequestHandler::hdf5_build_data(), and HDF5RequestHandler::hdf5_build_dds().

Here is the call graph for this function:

find_gloattr ( hid_t  file,
DAS &  das 
)

will fill in attributes of the root group into one DAS table.

The attributes are treated as global attributes.

Parameters
dasDAS object reference
fileHDF5 file id
Exceptions
msgstring of error message to the dods interface.
Returns
void

Definition at line 683 of file h5das.cc.

References get_hardlink(), and read_objects().

Referenced by HDF5RequestHandler::hdf5_build_das(), HDF5RequestHandler::hdf5_build_data(), and HDF5RequestHandler::hdf5_build_dds().

Here is the call graph for this function:

get_hardlink ( hid_t  pgroup,
const string &  oname 
)

will put hardlink information into a DAS table.

Parameters
pgroupobject id
onameobject name: absolute name of a group
Returns
true if succeeded.
false if failed.
Remarks
In case of error, it returns a string of error message to the DAP interface.
Warning
This is only a test, not supported in current version.

Definition at line 824 of file h5das.cc.

References HDF5PathFinder::add().

Referenced by depth_first(), and find_gloattr().

Here is the call graph for this function:

void get_softlink ( DAS &  das,
hid_t  pgroup,
const char *  gname,
const string &  oname,
int  index,
size_t  val_size 
)

Definition at line 765 of file h5das.cc.

Referenced by depth_first().

print_attr ( hid_t  type,
int  loc,
void *  sm_buf 
)

will get the printed representation of an attribute.

This function is based on netcdf-dods server.

Parameters
typeHDF5 data type id
locthe number of array number
sm_bufpointer to an attribute
Returns
a char * to newly allocated memory, the caller must call delete []
Todo:

This probably needs to be re-considered!

Due to the priority of the handler work, this function will not be

re-written in this re-engineering process. KY 2011-Nov. 14th

Definition at line 288 of file h5das.cc.

References NULL.

Referenced by nc_read_dataset_attributes(), and read_objects().

read_comments ( DAS &  das,
const string &  varname,
hid_t  oid 
)

will fill in attributes of a group's comment into DAS table.

Parameters
dasDAS object: reference
varnameabsolute name of an object
oidobject id
Returns
nothing

Definition at line 868 of file h5das.cc.

References comment, and NULL.

Referenced by depth_first().

void read_objects ( DAS &  das,
const string &  varname,
hid_t  oid,
int  num_attr 
)

will fill in attributes of a dataset or a group into one DAS table.

Parameters
dasDAS object: reference
varnameabsolute name of an HDF5 dataset or an HDF5 group
oidHDF5 object id(a handle)
num_attrnumber of attributes.
Returns
nothing
See also
get_attr_info(hid_t dset, int index, DSattr_t * attr_inst_ptr,int *ignoreptr, char *error)
get_dap_type()

Definition at line 481 of file h5das.cc.

References get_attr_info(), get_dap_type(), HDF5_OBJ_FULLPATH, DSattr::name, DSattr::ndims, DSattr::need, DSattr::nelmts, NULL, print_attr(), and DSattr::type.

Referenced by depth_first(), and find_gloattr().

Here is the call graph for this function:

Variable Documentation

A variable for remembering visited paths to break cyclic HDF5 groups.

Definition at line 42 of file h5das.cc.