InputFileHDF5 Namespace Reference

Namespace for file input specifics. More...

## Classes

struct | ParseLayersInfo
| struct used to pass the class and partition info back to the parseLayers() callback More...

## Functions

FIELD3D_API herr_t | parseLayers (hid_t loc_id, const char *partitionName, const H5L_info_t *linfo, void *opdata)
| Gets called from readPartitionAndLayerInfo to check each group found under the root of the file. It checks to see if it can find a "partition" and then passes that to writePartition.
FIELD3D_API herr_t | parsePartitions (hid_t loc_id, const char *partitionName, const H5L_info_t *linfo, void *opdata)
| Gets called from readPartitionAndLayerInfo to check each group found under the root of the file. It checks to see if it can find a "partition" and then passes that to writePartition.

## Detailed Description

Namespace for file input specifics.

## Function Documentation

## parsePartitions()

herr_t InputFileHDF5::parsePartitions | ( | hid_t | loc_id,
|  | const char * | partitionName,
|  | const H5L_info_t * | linfo,
|  | void * | opdata )

Gets called from readPartitionAndLayerInfo to check each group found under the root of the file. It checks to see if it can find a "partition" and then passes that to writePartition.

Definition at line 1130 of file Field3DFileHDF5.cpp.

{
GlobalLock lock(g_hdf5Mutex);
herr_t status;
H5O_info_t infobuf;
status = H5Oget_info_by_name(loc_id, itemName, &infobuf, H5P_DEFAULT);
if (status < 0) {
return -1;
}
if (infobuf.type == H5O_TYPE_GROUP) {
// Check that we have a name
if (!itemName) {
return -1;
}
// check that this group is not "groupMembership"
if (string(itemName) != "field3d_group_membership" &&
string(itemName) != "field3d_global_metadata")
{
// Get a pointer to the file data structure
Field3DInputFileHDF5* fileObject = static_cast<Field3DInputFileHDF5*>(opdata);
if (!fileObject) {
return -1;
}
return fileObject->parsePartition(loc_id, itemName);
}
}
return 0;
}
g_hdf5Mutex
FIELD3D_NAMESPACE_OPEN FIELD3D_API boost::recursive_mutex g_hdf5Mutex
Definition Hdf5Util.cpp:67
GlobalLock
boost::recursive_mutex::scoped_lock GlobalLock
Definition Hdf5Util.h:78
Field3DInputFileHDF5::parsePartition
herr_t parsePartition(hid_t loc_id, const std::string partitionName)
Gets called from parsePartitions. Not intended for any other use.
Definition Field3DFileHDF5.cpp:800

References g_hdf5Mutex, and Field3DInputFileHDF5::parsePartition().

Referenced by Field3DInputFileHDF5::readPartitionAndLayerInfo().

## parseLayers()

herr_t InputFileHDF5::parseLayers | ( | hid_t | loc_id,
|  | const char * | partitionName,
|  | const H5L_info_t * | linfo,
|  | void * | opdata )

Gets called from readPartitionAndLayerInfo to check each group found under the root of the file. It checks to see if it can find a "partition" and then passes that to writePartition.

Definition at line 1170 of file Field3DFileHDF5.cpp.

{
GlobalLock lock(g_hdf5Mutex);
herr_t status;
H5O_info_t infobuf;
status = H5Oget_info_by_name (loc_id, itemName, &infobuf, H5P_DEFAULT);
if (infobuf.type == H5O_TYPE_GROUP) {
// Check that we have a name
if (!itemName)
return -1;
// Get a pointer to the file data structure
ParseLayersInfo* info = static_cast<ParseLayersInfo*>(opdata);
if (!info)
return -1;
// Open up the layer group
H5ScopedGopen layerGroup(loc_id, itemName);
// Check if it's a layer
string classType;
try {
if (!readAttribute(layerGroup.id(), "class_type", classType)) {
return 0;
}
if (classType == string("field3d_layer"))
return info->file->parseLayer(layerGroup.id(), info->partitionName,
itemName);
}
catch (MissingAttributeException &) {
}
return 0;
}
return 0;
}
Field3DInputFileHDF5::parseLayer
herr_t parseLayer(hid_t loc_id, const std::string &partitionName, const std::string &layerName)
Gets called from parsePartitions. Not intended for any other use.
Definition Field3DFileHDF5.cpp:814
Hdf5Util::H5ScopedGopen
Scoped object - opens a group on creation and closes it on destruction.
Definition Hdf5Util.h:195
Hdf5Util::readAttribute
FIELD3D_API bool readAttribute(hid_t location, const std::string &attrName, std::string &value)
Reads a string attribute.
InputFileHDF5::ParseLayersInfo
struct used to pass the class and partition info back to the parseLayers() callback
Definition Field3DFileHDF5.h:885
InputFileHDF5::ParseLayersInfo::file
Field3DInputFileHDF5 * file
Definition Field3DFileHDF5.h:886
InputFileHDF5::ParseLayersInfo::partitionName
std::string partitionName
Definition Field3DFileHDF5.h:887

References InputFileHDF5::ParseLayersInfo::file, g_hdf5Mutex, Hdf5Util::H5Base::id(), Field3DInputFileHDF5::parseLayer(), InputFileHDF5::ParseLayersInfo::partitionName, and Hdf5Util::readAttribute().

Referenced by Field3DInputFileHDF5::readPartitionAndLayerInfo().